plus.maps.Map.reverseGeocode(point, {}, (event) => {
console.log(JSON.stringify(event))
var address = event.address; // 转换后的地理位置
var point = event.coord; // 转换后的坐标信息
var coordType = event.coordType; // 转换后的坐标系类型
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
var addressList = address.match(reg).toString().split(",");
//注意 因为存在直辖市, 当所在地区为普通省市时,addressList.length == 3,city = addressList[1];当所在地区为直辖市时addressList.length == 2,city = addressList[0];
// that.cityName = addressList.length == 3?addressList[1]:addressList[0];
console.log(addressList);
},
function(e) {
console.log("失败回调", e);
}
);
报错信息:
{"code":-100,"message":"[Maps高德地图:1008]未知错误, http://lbs.amap.com/api/android-sdk/guide/error/"}
0 个回复