利用google map api 经纬度计算两点间距离

  1. //根据经纬度计算两点距离  
  2.   var distance = new GLatLng(39.917, 116.397).distanceFrom(new GLatLng(37.4419, -122.1419));  
  3.   alert(parseInt(distance/1000,10) + "公里");  

源自:http://www.iteye.com/topic/582657

posted @ 2012-12-19 10:38  tangrongyue  Views(1232)  Comments(0Edit  收藏  举报