wx.getLocation调用为什么一直fail?
发布于 3 年前 作者 naluo 6305 次浏览 来自 官方Issues

handlePosition() {
      wx.getLocation({
        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
        success: (res) => {
          this.lnglat = {
            lng: res.longitude,
            lat: res.latitude,
          }
          this.drawPoint()
          this.queryAddress()
        }
      });
    }

扫码的可以调用,但是手机微信里getLocation调用一直fail。在开发者工具中是可以调用成功的。这是为什么?

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),并详细描述下复现流程

回到顶部