var location = [];
function getAddrGeo(addr) {
//获取某地址的经纬度可用于移动端跳转app导航
$.ajax({
type: "GET",
url:
"http://restapi.amap.com/v3/geocode/geo?key=你的高德key&s=rsv3&address=" +
addr.trim(),
success: function (response) {
location =
response.geocodes[0] && response.geocodes[0].location.split(",");
},
error: function (e) {
console.log("地址坐标获取失败", e);
},
});
}
网友评论