第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > getLocation:fail auth deny

getLocation:fail auth deny

时间:2020-02-20 09:21:57

相关推荐

getLocation:fail auth deny

getLocation:fail auth deny

简述

在小程序获取当前位置经纬度时,报错getLocation:fail auth deny

获取代码

getNowPosition(){// 获取当前的地理位置var that = thisconsole.log(888);wx.getLocation({type: 'gcj02', success: function (res) {//赋值经纬度that.setData({latitude: res.latitude,longitude: res.longitude,})console.log('经度',res.longitude);console.log('纬度',res.latitude);},fail: function (errInfo) {console.info(errInfo,8889)}})},

原因

微信定位没有打开造成的

解决

按照以下步骤打开即可

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。
扩展阅读