iOS中MapKit中的经纬度是如何理解的
巴扎黑
巴扎黑 2017-04-18 09:43:19
[iOS讨论组]
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)是左上角

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

巴扎黑
巴扎黑

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号