刘
刘大可
V1
2022/11/24阅读:23主题:默认主题
模糊定位
wx.getFuzzyLocation({
success:(res)=>{
console.log(res);
const latitude = res.latitude
const longitude = res.longitude
wx.openLocation({
latitude,
longitude,
scale: 18
})
},
fail:(err)=>{
console.log(err);
}
})
manifest.json
{
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
},
"scope.userFuzzyLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos" : [ "chooseLocation","getFuzzyLocation" ],
}
作者介绍
刘
刘大可
V1