【问题标题】:Map Bounding Box NE and SW, get NW and SE映射边界框 NE 和 SW,得到 NW 和 SE
【发布时间】:2018-07-10 22:37:47
【问题描述】:

我有两个CLLocationCoordinate2D,它们代表地图上的可见坐标区域/框。它们是NE角和SW角。

CLLocationCoordinate2D neCoordinate = self.mapboxMapView.visibleCoordinateBounds.ne;
CLLocationCoordinate2D swCoordinate = self.mapboxMapView.visibleCoordinateBounds.sw;

如何在数学上转换这两个坐标以找到 NW 和 SE 坐标/角?

【问题讨论】:

    标签: objective-c mapkit coordinates core-location


    【解决方案1】:

    你不能从每个坐标中提取出等价点,然后用你自己的方式组合它们吗?

    neCoordinate.latitude(东)和swCoordinate.longitude(南)制作 SECoordinate?

    neCoordinate.longitude(北)和swCoordinate.latitude(西)制作NWCoordinate?

    又名:

    CLLocationCoordinate2D seCoordinate = CLLocationCoordinate2DMake(latitude: neCoordinate.latitude, longitude: swCoordinate.longitude);
    CLLocationCoordinate2D nwCoordinate = CLLocationCoordinate2DMake(latitude: swCoordinate.latitude, longitude: neCoordinate.longitude);
    

    【讨论】:

    • 成功了!虽然在测试中你切换了seCoordinatenwCoordinate
    猜你喜欢
    • 2013-08-11
    • 1970-01-01
    • 2010-11-29
    • 2012-03-16
    • 1970-01-01
    • 2016-08-28
    • 2016-01-14
    • 2015-07-12
    • 1970-01-01
    相关资源
    最近更新 更多