wx.getLocation 在华为部分机型 定位 返回404 type为gcj02 时定位 404 type为wgs84时 定位没有问题
wx.getLocation({
type: 'gcj02',
isHighAccuracy: true,
highAccuracyExpireTime: 3000,
success: function (success) {
let string = '/ws/geocoder/v1?' + 'key=' + app.globalData.key + '&location=' + success.latitude + ',' + success.longitude + app.globalData.SK;
console.log("string", string);
let MD5String = MD5(string);
wx.hideLoading();
_this.setData({
latitude: success.latitude,
longitude: success.longitude
})
let data = {
location: success.latitude + ',' + success.longitude,
key: app.globalData.key,
}
HTTP.HTTPGET({
url: API.getAddressName,
data: data,
success: function (res) {
_this.setData({
address: res.result.formatted_addresses.recommend
})
},
fail: function (error) {
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
complete: function (com) {
console.log('com', com)
}
})
}
})
你好,麻烦提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),以及相关的报错截图看看。