wx.getLocation文档和获取到的数据不同
发布于 5 年前 作者 xiuying50 15084 次浏览 来自 官方Issues
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html

wx.getLocation({
  type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
  success: function (res) {
    var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
    var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
    var speed = res.speed; // 速度,以米/每秒计
    var accuracy = res.accuracy; // 位置精度
  }
});

公众号文档中获取当前位置有返回位置经度,单实际上只返回了经纬度这是为什么
{
  errMsg"getLocation:ok"
  latitude''
  longitude''
}
1 回复
回到顶部