用高德sdk,安卓手机可以正常获取经纬度。可是用到苹果就不行了?获取不到经纬度!
发布于 7 年前 作者 jiewu 13806 次浏览 来自 官方Issues

小程序有用到地图,用的是高德sdk,安卓手机可以正常获取经纬度。可是用到苹果就不行了?获取不到经纬度!

//获取当前位置的经纬度
   loadTudeInfo: function() {
     var that = this;
     wx.getLocation({
       type: "gcj02", //返回可以用于wx.openLocation的经纬度
       success: function(res) {
         that.latitude = res.latitude; //维度
         that.longitude = res.longitude; //经度
         // console.log(res);
         console.log(that.latitude);
         console.log(that.longitude);
         
       }
     });
   },
1 回复

有大佬指点下吗

回到顶部