html52.com
我爱小程序-开发者交流社区

调用 wx.chooseLocation后返回值为null?

我自己开发的一个gps转换小功能,需要选择位置经过装换后给出多个经纬度,在开发工具和我自己账号下是没有问题的,但是在其他成员使用体验版的时候,点击选择定位后无法打开地图,直接返回null,请问是什么原因呢?

  openlocation:function(){
    var that=this
    wx.getLocation({
    })
    wx.chooseLocation({
         complete(res) => {
           console.log(res)
           let newGps=gpschange.transformFromWGSToGCJ(res.latitude,res.longitude)
           console.log(newGps)
           let newGps2=gpschange.transformFromGCJToBaidu(newGps.latitude,newGps.longitude)
           console.log(newGps2)
           let newGps3=gpschange.transformFromGCJToWGS(newGps.latitude,newGps.longitude)
           console.log(newGps3)
           that.setData({
             WGS:res,
             baidu:newGps2,
             GCJ:newGps,
             wgs:newGps3
           })
           console.log(that.data.WGS)
           console.log(that.data.GCJ)
           console.log(that.data.baidu)
         },
         fail:(res) =>{
          that.setData({
            errorFlag:"定位失败",
            hidFlag:false
          })
         },
  })
  },

网友回复

smart:

GPS 打开没有?

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付