let location = `${dataS.lat},${dataS.lon}`//金纬度
getLocation(location) {
let _this = this;
const key = '6ed14668ba400973a' //web高德key
let reqUrl = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${location}`
return new Promise((resolve, reject) => {
uni.request({
method: "GET",
url: reqUrl,
success: (res) => {
const address = res.data.regeocode.addressComponent
this.address = `${address.city}${address.district}${address.streetNumber.street}`
// console.log(address);
}
})
})
},
uniapp逆地理编码
最新推荐文章于 2025-02-06 12:02:14 发布