代码如下
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
that.setData({
latitude: latitude,
longitude: longitude
});
}
})
在苹果手机上,定位的时候经度为小数点后4位,维度时而小数点后4位时而后5位。
在Android机上,一直都是经纬度小数点后6位。
导致最后两款手机定位回来的数据偏差较大。最夸张的有时候偏差超过200米,导致定位到另一个住宅区了。
请问这个地方有没有什么办法来控制一下精确度

兄弟帮我看看这个帖子的问题
不好意思 理解错了 你这个还真没考虑过。。。
ios截图
Android截图
兄弟啊,你可能理解错了。我wx.getLocation方法res的返回值就是不精确的。ios只有4位精度啊,Android有6位精度
就是进入画面之后 不管定位准不准 两秒后重新定位你给的坐标
方法可行 一样定位不准 就是用这个方法解决的
这是什么意思不明白
在 onshow里面写一个延迟重定位方法
setTimeout(function () {
console.log("2秒延迟")
that.setData({
longitude: app.globalData.longitude,
latitude: app.globalData.latitude,
})
that.mapinfo.moveToLocation()
}, 2000)