简体   繁体   English

在iPhone应用程序中旋转MKMapView

[英]Rotate MKMapView in iPhone application

I do not want any code but want to get reference for MKMapView compass rotation as shown in http://vimeo.com/7970239 . 我不想要任何代码,但想要获得MKMapView指南针旋转的参考,如http://vimeo.com/7970239所示。

Can anyone tell me that is it possible or not? 任何人都可以告诉我这是否可能?

Please help me to solve this problem.. 请帮我解决这个问题..

Thanks in advance... 提前致谢...

It is certainly possible, here is the very line that makes it work: 这当然是可能的,这是使它工作的线:

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

In order to receive the heading events, you need to create a CLLocationManager and do [locationManager startUpdatingHeading]; 为了接收标题事件,您需要创建一个CLLocationManager并执行[locationManager startUpdatingHeading];

Hope it helps you 希望它能帮到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM