小程序正式版代码在未经过修改和更新的情况下,最近一周出现了该问题.
然而在微信开发者工具中测试时不会产生该问题.到了预览与正式版的时候就会出现.报错信息为:
{errMsg: "moveToMapLocation:fail error mapid"}
请问是需要去申请开通哪些新的接口权限?又或者是需要在隐私申明文件中新增哪条新的隐私协议?还是如何解决?
(在正式版中,如果moveToLocation不指定longitude与latitude参数的话则不会出现该报错,但我需要将地图的位置移动到服务器存储的已设置的位置)
代码片段:
_mapCtx = wx.createMapContext('map');
_mapCtx.moveToLocation({
longitude:longitude,
latitude:latitude,
success:(res)=>{
console.log(res);
_this.data.stopInfo.longitude = longitude;
_this.data.stopInfo.latitude = latitude;
console.log(_this.data.stopInfo);
_this.getAddressName(_this.data.stopInfo.longitude,_this.data.stopInfo.latitude);
},fail:(res)=>{
console.log(res);
}

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
已经解决了,官方回答都是片面的。
只需要在调用失败的时候,延迟1秒在循环调用就可以了。
可能是部分手机性能不佳导致第一次moveToLocation失败