用高德sdk,安卓手机可以正常获取经纬度。可是用到苹果就不行了?获取不到经纬度!
小程序有用到地图,用的是高德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);[代码][代码] [代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码]