小程序
小游戏
企业微信
微信支付
扫描小程序码分享
小程序wx.getLocation type gcj02 isHighAccuracy true 用真机调试 误差20米左右 还有其他的操作弥补误差么?
7 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
type: 'gcj02', //wgs84刚开始填的这个,找了半天问题改成 gcj02暂时ok
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
调用小程序wx.getLocation,获取当前位置误差在几千米,这正常吗
小白,几千米的误差真么办
getLocation: function(e) {
console.log(e)
var that = this
var newlocation
wx.getLocation({
success: function(res) {
type: 'gcj02'
altitude: true
isHighAccuracy: true
console.log(res)
const {
longitude,
latitude,
speed,
accuracy
} = res
newlocation = {
...that.data.location,
longitude: longitude,
latitude: latitude,
speed: speed,
accuracy: accuracy
}
console.log('11111', newlocation)
that.setData({
hasLocation: true,
location: newlocation
})
demo.reverseGeocoder({
console.log(res.result);
address,
adcode,
ad_info
} = res.result
...newlocation,
address: address,
adcode: ad_info.adcode,
city_code: ad_info.city_code
},
fail: function(res) {
console.log(res);
各位大佬。开发工具没有误差,真机调试有几百米误差 ,这个有遇到过吗
改了也没用,不知道怎么情况
有误差很正常,我这边都快50米的误差了
wx.onLocationChange测试下?
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
type: 'gcj02', //wgs84刚开始填的这个,找了半天问题改成 gcj02暂时ok
调用小程序wx.getLocation,获取当前位置误差在几千米,这正常吗
小白,几千米的误差真么办
getLocation: function(e) {
console.log(e)
var that = this
var newlocation
wx.getLocation({
success: function(res) {
type: 'gcj02'
altitude: true
isHighAccuracy: true
console.log(res)
const {
longitude,
latitude,
speed,
accuracy
} = res
newlocation = {
...that.data.location,
longitude: longitude,
latitude: latitude,
speed: speed,
accuracy: accuracy
}
console.log('11111', newlocation)
that.setData({
hasLocation: true,
location: newlocation
})
demo.reverseGeocoder({
success: function(res) {
console.log(res.result);
const {
address,
adcode,
ad_info
} = res.result
newlocation = {
...newlocation,
address: address,
adcode: ad_info.adcode,
city_code: ad_info.city_code
}
that.setData({
hasLocation: true,
location: newlocation
})
},
fail: function(res) {
console.log(res);
}
})
}
})
},
各位大佬。开发工具没有误差,真机调试有几百米误差 ,这个有遇到过吗
改了也没用,不知道怎么情况
有误差很正常,我这边都快50米的误差了
定位误差和手机定位有关,换个好手机吧
wx.onLocationChange测试下?