wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success (res) {
const latitude = 30.838813;//res.latitude
const longitude = 104.331081;//res.longitude
console.log(latitude+"-"+longitude);
wx.openLocation({
latitude,
longitude,
scale: 18,
name:"地图上显示的标点名称"
})
},fail(res){
console.log(res)
}
})
- THE END -
最后修改:2020年12月13日
非特殊说明,本博所有文章均为博主原创。