function get_location_value(address) {
var geocoder = new AMap.Geocoder({
city: "深圳", //城市,默认:“深圳”
radius: 1000 //范围,默认:500
});
// console.log(address);
geocoder.getLocation(address, function(status, result) {
if (status === 'complete' && result.info === 'OK') {
loc_value = result.geocodes["0"].location;
position_value = [loc_value.getLng(),loc_value.getLat()]; // 获取坐标
console.log(position_value);
**return position_value;**
}
else{
console.log("wrong");
}
});
}
排查了二十分钟,神坑啊