iOS中MapKit中的经纬度是如何理解的

var topLeftCoord = CLLocationCoordinate2D(latitude: -90, longitude: 180)
var bottomRightCoord = CLLocationCoordinate2D(latitude: 90, longitude: -180)

for annotation in annotations {
    topLeftCoord.latitude = max(topLeftCoord.latitude, annotation.coordinate.latitude)
    topLeftCoord.longitude = min(topLeftCoord.longitude, annotation.coordinate.longitude)
    bottomRightCoord.latitude = min(bottomRightCoord.latitude, annotation.coordinate.latitude)
    bottomRightCoord.longitude = max(bottomRightCoord.longitude, annotation.coordinate.longitude)
    
    
}

请问一下我看到一段代码,我的理解是topLeftCoord是指左上角的坐标,bottomRightCoord是右下角的坐标,那么就在mapView中的一块范围显示了所有的位置图钉。latitude是指维度,longitude是指经度。我在百度地图中 http://api.map.baidu.com/lbsa... 用鼠标获取了一下。
var topLeftCoord = CLLocationCoordinate2D(latitude: -90, longitude: 180)是右下角
var bottomRightCoord = CLLocationCoordinate2D(latitude: 90, longitude: -180)是左上角

是反过来的,所以请问一下,我应该怎么理解经纬度的正负和方位呢???谢谢

阅读 2.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题