location格式 => (经度, 纬度)
var url = 'https://restapi.amap.com/v3/distance?origins=' + location1 + '&destination=' + location2 + '&output=json&key=a1c43dc463bbf46806fbcde9581c9d79&type=0';
$.ajax({
url: url,
success: function (res) {
if (res.status == 1) {
alert("距离项目地址" + res.results[0].distance + "米");
}
},
error: function (res) {
alert("error")
}
})