在我的 iPhone 应用程序中,我使用 CLLocationManager 来查找我的 iphone 指向的方向。我正在使用属性“标题”。它给了我 x、y 和 z 值。如何从这些值中找到我当前指向的方向(北或南或东或西)?
问问题
2228 次
2 回答
1
您应该使用方法[locationManager startUpdateHeading]
来获取相对于地理北极或磁北极的角度。然后你可以得到价值
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
NSLog(@"%f",newHeading.trueHeading);
}
于 2010-12-10T08:25:26.120 回答
0
heading
是一个CLHeading
对象。一看文档就会告诉您,它还具有以度为单位的真航向和磁航向的属性。
于 2010-11-28T12:09:40.363 回答