wx.getLocation获取的经纬度不准
发布于 6 年前 作者 jing06 15604 次浏览 来自 问答
  • 当前 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 回复

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

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

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

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

回到顶部