var address = this.form.province + this.form.city + this.form.region + this.form.fullAddress
const that = this;
wx.request({
url: `https://restapi.amap.com/v3/geocode/geo?address=${
address}&key=6b26c2c58770d13a4ecf2b96615dbaee`,
method: "get",
success(res) {
if (res.data.status == 1) {
console.log(res.data, '130---------')
const address = res.data.geocodes[0].location.split(",");
// 这里转化为数字类型,因为这里是用腾讯内置地图map来显示,需要转为number类型才显示
that.latitude = Number(address[1]); //纬度
that.longitude = Number(address[0]);//经度
}
},
});
uniapp uses Gaode map to obtain the demo effect of latitude and longitude according to the detailed address (organization)
Guess you like
Origin blog.csdn.net/qq_38881495/article/details/131535790
Ranking