getCity() {
const QQMapWX = new qqmapsdk({
//腾讯地图 需要用户自己去申请key
key: "SFABZ-WANWW-FISRY-3IGTF-HV7RE-YSFTI"
});
let that = this;
QQMapWX.reverseGeocoder({
location: {
latitude: that.myPinInfo.latitude,
longitude: that.myPinInfo.longitude
},
success: function(res) {
console.log('解析地址成功', res);
that.result = res.result
uni.showModal({
title: "解析地址",
content: "解析地址 = " + JSON.stringify(res)
})
let province = res.result.ad_info.province; // 市
let city = res.result.address;
},
fail: function(res) {
console.log(res);
},
complete: function(res) {
console.log(res);
}
});
},