wx.getlocation和moveToLocation获取到的坐标不一致?
获取到的经纬度都有点偏移,请问下是我代码的问题,还是这两个方法的实现不一样?
代码如下:
onReady: function() {
let that = this;
this.mapCtx = wx.createMapContext('myMap'); //map上下文
wx.getLocation({
success: function(res) {
that.setData({
latitude: res.latitude,
longitude: res.longitude
})
console.log("通过getLocation获取:\nlatitude=" + that.data.latitude + "\nlongitude=" + that.data.longitude);
that.moveToLocation()
},
})