Eri*_*son 8 iphone mapkit cllocationmanager
在"地图"应用程序中的iPhone 3GS上,您可以单击通常显示您的位置两次的图标,蓝点获得看起来像前照灯的光束,基本上显示您在地图上面向的方向并旋转图像因此.
使用MapKit MapView可以使用此选项吗?
我知道我可以用类似的东西来获得我的标题
- (void)locationManager:(CLLocationManager *) manager didUpdateHeading:(CLHeading *) newHeading {
Run Code Online (Sandbox Code Playgroud)
//如果准确性有效,请处理事件.
if (newHeading.headingAccuracy > 0) {
CLLocationDirection theHeading = newHeading.magneticHeading;
...
}
Run Code Online (Sandbox Code Playgroud)
}
但我不知道如何在Mapkit中获得那么好的前照灯效果,似乎没有任何文档.
有任何想法吗?
添加用户跟踪模式也有帮助。我知道我迟到了,但可能对像我这样的其他开发人员有所帮助:)
self.mapView.userTrackingMode = RMUserTrackingModeFollowWithHeading;
Run Code Online (Sandbox Code Playgroud)
我可以想到一种方法,虽然我没有实施,但可能对你有一点帮助。
didUpdateHeading使用 x 和 y 值来计算方向的角度。请发布您对上述方法的建议/更改。