如何获取两个经纬度直接的实际距离

109 views
Skip to first unread message

likey

unread,
Oct 25, 2008, 12:56:54 AM10/25/08
to Google 地图 API 讨论组
就是有两个经纬度坐标,求这两个直接的距离,不是直线距离,而是像在地图上折线画出来的距离,Google map能实现吗?具体怎么实现的?望高手教
我,谢谢

Phinix

unread,
Oct 25, 2008, 7:11:06 AM10/25/08
to Google 地图 API 讨论组
使用GLatLng的distanceFrom(other)方法,这个默认是按地球的曲率来计算距离的,返回以米为单位的数字

API的对应链接在这里: http://code.google.com/intl/zh-CN/apis/maps/documentation/reference.html#GLatLng
Reply all
Reply to author
Forward
0 new messages