在iPhone应用程序中旋转MKMapView

问题描述:

我不想要任何代码,但希望获得MKMapView指南针旋转的参考,如 http://vimeo.com/ 7970239

I do not want any code but want to get reference for MKMapView compass rotation as shown in http://vimeo.com/7970239.

任何人都可以告诉我这是否可能?

Can anyone tell me that is it possible or not?

请帮助我解决这个问题..

Please help me to solve this problem..

提前致谢...

这当然是可能的,这是使它工作的线:

It is certainly possible, here is the very line that makes it work:

[self.map setTransform:CGAffineTransformMakeRotation(-1 * newHeading .magneticHeading * M_PI / 180)];

为了接收标题事件,你需要创建一个 CLLocationManager 并执行 [locationManager startUpdatingHeading];

In order to receive the heading events, you need to create a CLLocationManager and do [locationManager startUpdatingHeading];

希望它可以帮到你