【问题标题】:Get MapKit view border coordinates获取 MapKit 视图边框坐标
【发布时间】:2011-05-24 23:42:54
【问题描述】:

如何获取 MapKit 视图边界坐标,例如我需要获取东北边界坐标和西南边界坐标。

谢谢。

【问题讨论】:

    标签: iphone objective-c mapkit


    【解决方案1】:
    MKCoordinateRegion region = mapView.region;
    
    minLat = region.center.latitude - (region.span.latitudeDelta / 2.0);
    maxLat = region.center.latitude + (region.span.latitudeDelta / 2.0);
    
    minLong = region.center.longitude - (region.span.longitudeDelta / 2.0);
    maxLong = region.center.longitude + (region.span.longitudeDelta / 2.0);
    

    东北坐标是 (maxLat, maxLong),西南坐标是 (minLat, minLong)。

    【讨论】:

    • 应该是minLat = region.center.latitude - (region.span.latitudeDelta / 2);等等吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-08
    相关资源
    最近更新 更多