使用 WhirlyGlobe 创建 CLLocation
我尝试使用tapmessage 的wheregeo 和worldloc 属性创建一个cllocation 对象。然而,经纬度和纬度我从它们获得的 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 点是 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
我正在使用 cllocation 默认值使用纬度和经度方法初始化
I have attempted creating a cllocation object using the tapmessage's wheregeo and worldloc properties. however the lat and lon & x, y values that i get from them are not able to be used to create a cllocation object. Maybe i am formatting incorrectly?
Thanks in advances
logging this
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());
gives me this
2012-01-19 12:30:22.491 WhirlyGlobeApp[1068:4007] x point is -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] from wheregeo 0.962698
2012-01-19 12:30:22.494 WhirlyGlobeApp[1068:4007] from wheregeo 1.815925
I am using the cllocation default init with latittude and longitude method
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是弧度与度数。坐标以弧度为单位,但您可能需要 CLLocation 的度数。
只需使用
GlobeMath.h
中的RadToDeg()
模板即可。看起来很奇怪,但只要像函数一样调用它即可。That would be radians vs. degrees. The coordinates are in radians, but you probably need degrees for
CLLocation
.Just use the
RadToDeg()
template inGlobeMath.h
. It looks weird, but just call it like a function.