FastOperator('mapInfo', null, 'post', function(mes)
{
for(var i = 0; i < mes.records.length; i++)
{
var pointStart = new plus.maps.Point(point.longitude, point.latitude);
var pointEnd = new plus.maps.Point(mes.records[i].longitude, mes.records[i].latitude);
plus.maps.Map.calculateDistance(pointStart, pointEnd, function(event)
{
var distance = event.distance;
distance = distance / 1000;
distance = distance.toFixed(1);
if(distance < 0.01)
{
distance = "当前位置(您的附近)";
}
else
{
distance = "距离您" + distance + "km";
}
console.log(distance);
}, function(e)
{
alert("Failed:" + JSON.stringify(e));
});
}
}, "获取地址失败");
幸运符
- 发布:2018-11-26 10:12
- 更新:2018-11-26 10:12
- 阅读:2261
0 个回复