wx.getLocation在微信开发者工具里面调用成功,但预览、真机测试调用的时候安卓返回fail
wx.getLocation,在微信开发者工具里面调用成功,但预览、真机测试、体验版调的时候安卓返回fail,已开启位置授权,手机也开启了定位服务
getLocation() {
var that = this
wx.getLocation({
type: 'gcj02 ',
success(res) {
console.log(res)
that.setData({
latitude: res.latitude,
longitude: res.longitude
})
that.data.covers.push({
id: 0,
latitude: that.data.latitude,
longitude: that.data.longitude,
iconPath: 'https://zysd-shanghai.oss-cn-shanghai.aliyuncs.com/mini-program/bdtui/shop/currlocation.png',
zIndex: '999',
rotate: 0,
width: 20,
height: 20
});
},
fail(err) {
console.log(err, 'fail')
}
})
},