百度地图:两点间距离

 var point1 = new BMap.Point(116.332782, 40.007978);
    var point2 = new BMap.Point(116.332782, 41.007978);
    var distance = map.getDistance(point1, point2);
    var mileage = (distance / 1000).toFixed(2);
    alert("与距离为" + mileage + "公里");

posted @ 2013-03-20 22:05  81  阅读(236)  评论(0编辑  收藏  举报