收藏
回答

为何wx.chooseLocation获取的经纬度用于wx.openLocation中定位相差很大?

//获取经纬度代码
wx.chooseLocation({
  success: (res) => {
    this.setData({
      "location.longitude": res.longitude,
      "location.latitude": res.latitude,
      "location.address": res.address,
      "location.addrName": res.name
    });
  }
});

//打开地图
let location = this.data.location;
wx.openLocation({
  latitude: location.latitude,
  longitude: location.longitude,
  name: location.addrName,
  address: location.address,
  success: res => {
    console.log(res)
  }
})

代码有什么问题吗?
回答关注问题邀请回答
收藏

4 个回答

登录 后发表内容
问题标签