wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success (res) {
const latitude = res.latitude
const longitude = res.longitude
console.log(latitude+"-"+longitude);
wx.openLocation({
latitude,
longitude,
scale: 18
})
}
})
app.json添加
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
- THE END -
最后修改:2020年8月6日
非特殊说明,本博所有文章均为博主原创。