最初我直接copy了文档下面的例子,上面type是wgs84 ,所以我也照着搬了过来。
后来发现wx.getLocation获取当前定位,发现跑偏了600多米。最后发现这里:


综上所述:此处应该用gcj02
Location: function() {
var that = this;
wx.getLocation({
type: "gcj02",
success: function(res) {
console.log(res)
that.setData({
latitude: res.latitude,
longitude: res.longitude
})
}
})
},