收藏
回答

wx.getLocation位置不准确?

开启了高精度,拿到坐标还是不准确。

onShow: function () {
    var that = this
    wx.getLocation({
      isHighAccuracytrue,
      type'wgs84',
      success(loc){
        console.log(loc)
        that.setData({
          position_lat:loc.latitude,
          position_lng:loc.longitude
        })
      },
      fail(res){
        console.log('fail',res)
      },
      complete(res){
        console.log('comp',res)
      }
    })
  }
回答关注问题邀请回答
收藏

3 个回答

  • 微盟
    微盟
    2021-02-25

    需要配置参数,注意版本

    2021-02-25
    有用
    回复
  • 今天你归零了嘛
    今天你归零了嘛
    2021-02-06

    需要写上这个参数highAccuracyExpireTime,文档中说高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果

    请看一下这个api【wx.getLocation】的具体参数,仔细阅读里面的参数和含义

    api链接:https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html




    2021-02-06
    有用
    回复 1
    • Will
      Will
      2021-02-06
      这个字段不起作用
      2021-02-06
      回复
  • 2021-02-06

    gcj02 返回可用于 wx.openLocation 的坐标, 是不是type填错了


    2021-02-06
    有用
    回复 1
    • Will
      Will
      2021-02-06
      您好,我不需要openLocation。我只是用gps坐标做个判断。
      2021-02-06
      回复
登录 后发表内容
问题标签