Rotate MKMapView in iPhone application

↘锁芯ラ 提交于 2020-01-03 04:59:07

问题


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..

Thanks in advance...


回答1:


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];

Hope it helps you



来源:https://stackoverflow.com/questions/7468557/rotate-mkmapview-in-iphone-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!