uniapp逆地理编码

56 阅读1分钟
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);
						}
					})
				})

			},