问题:小程序发布线上后逆地址解析不生效,获取不到位置地址
在本地调试,体验版未出现该问题,正式发版后会出现该问题
解决:在微信公众平台,开发管理 —>服务器域名—>request合法域名中添加
https://apis.map.qq.com |
”
_this.$qqmapsdk.reverseGeocoder({
//SDK调用
location: {
latitude,
longitude,
},
success: function(res) {
// 获取到当前位置地址
_this.overF.location = res.result.address;
if (num == 1) {
_this.signIn(
_this.projectId,
_this.overF.location,
latitude,
longitude
);
} else {
_this.signOut(_this.overF.location);
}
console.log("sdk", _this.overF.location);
},
fail: function(error) {
console.error('error',error);
},
complete: function(res) {
console.log(res);
}
});