Ios 使用WhirlyGlobe创建CLLocation

Ios 使用WhirlyGlobe创建CLLocation,ios,cllocation,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(@"fr

我尝试使用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应用程序[1068:4007]x点为-0.138646

2012-01-19 12:30:22.492应用程序[1068:4007]y点为0.554229

2012-01-19 12:30:22.493 WhirlyGlobeApp[1068:4007]其中GEO 0.962698

2012-01-19 12:30:22.494 WhirlyGlobeApp[1068:4007]其中GEO 1.815925


我使用的是带有纬度和经度方法的cllocation default init

,即弧度和度。坐标以弧度为单位,但您可能需要
CLLocation
的度数

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