使用WhirlyGlobe创建CLLocation

时间:2012-01-19 17:33:54

标签: ios cllocation

我尝试使用tapmessage的wheregeo和worldloc属性创建一个cllocation对象。然而,lat和lon&我从中获得的x,y值无法用于创建cllocation对象。也许我格式不正确?

谢谢你的进步

记录此

GeoCoord coord = msg.whereGeo;
Point3f point = msg.worldLoc;
NSLog(@"x point is %f",point.x());
NSLog(@"y point is %f",point.y());
NSLog(@"from wheregeo %f",coord.lat());
NSLog(@"from wheregeo %f",coord.lon());

给了我这个

2012-01-19 12:30:22.491 WhirlyGlobeApp [1068:4007] x点是-0.138646

2012-01-19 12:30:22.492 WhirlyGlobeApp [1068:4007] y point is 0.554229

2012-01-19 12:30:22.493 WhirlyGlobeApp [1068:4007]来自wheregeo 0.962698

2012-01-19 12:30:22.494 WhirlyGlobeApp [1068:4007]来自wheregeo 1.815925

我正在使用带有latittude和经度方法的cllocation默认初始化

1 个答案:

答案 0 :(得分:2)

那将是弧度与度数。坐标以弧度为单位,但您可能需要CLLocation的度数。

只需使用RadToDeg()中的GlobeMath.h模板即可。它看起来很奇怪,但只是把它称为函数。

相关问题