【问题标题】:Create CLLocation using WhirlyGlobe使用 WhirlyGlobe 创建 CLLocation
【发布时间】:2015-11-12 03:41:49
【问题描述】:

我尝试使用 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 点为 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

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

【问题讨论】:

    标签: ios cllocation


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2014-11-16
      • 1970-01-01
      • 1970-01-01
      • 2012-02-01
      • 2015-08-10
      • 2011-12-06
      • 2015-05-28
      • 2017-07-21
      • 1970-01-01
      相关资源
      最近更新 更多