wx.getLocation获取的经纬度不准

发布于 7 年前作者 jing0615721 次浏览最后编辑 7 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

  • 预期表现

通过wx.getLocation拿到准确定位

wx.getLocation拿到的位置

113.39350

23.09786

wx.chooseLocation拿到的位置

113.39905

23.09543

  • 复现路径

  • 提供一个最简复现 Demo

// 获取用户位置

getUserLocation: function () {

var that = this

wx.getLocation({

// type: ‘wgs84’,

type: ‘gcj02’,

success(res) {

var latitude = res.latitude

var longitude = res.longitude

that.setData({

latitude: latitude,//纬度  不准

longitude: longitude,//经度   不准

})

}

})

},

3 回复
jwen
jwen1 楼6 年前

不是真是的位置=>这是什么意思?

weizhao
weizhao2 楼6 年前

wx.getLocation应该是先返回缓存GPS地址吗?什么情况下刷新呢?官方能给回复吗

xia30
xia303 楼5 年前

wx.getLocation应该是先返回缓存地址,是缓存的上一次的真实地址。

这个机制是我们猜的,你可以试试。