在iPhone应用程序中旋转MKMapView [英] Rotate MKMapView in iPhone application

查看:90
本文介绍了在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];

希望它可以帮到你

这篇关于在iPhone应用程序中旋转MKMapView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆