收藏
回答

小程序有两个mapContext实例,先创建的实例API不执行

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug mapContext 工具 在开发工具上调试出现的bug 2.3.0


小程序有两个页面 index 和adv ,每个页面都使用了map组件,并且在onLoad函数里创建了mapContext,

index.wxml

<map id="qqMap" style="width: 100%; height: {{screenHeightMap}}px;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" bindmarkertap="showTipWin" bindtap="closeTipWin" bindregionchange="regionchange"  bindcallouttap="btnCallout" show-location>


index.js  

onLoad: function (option) {  

   this.mapCtx = wx.createMapContext('qqMap');

 },


adv.wxml  

<map id="advMap"style="width: 100%; height: 190px;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" show-location circles="{{circles}}" bindtap="ontapstart" bindregionchange="regionchange">


adv.js

onLoad: function (options) {

   this.mapCtxAdv = wx.createMapContext('advMap');

     },

   

微信小程序开发工具,基础库 2.3.0

编译完成后,首先进入的是index 页面,此时mapCtx下的所有API函数都正常,当跳转到adv页面后,再跳转回到index页面,则mapCtx下的所有API都不执行了

有哪位大神遇到过这种情况,求大神帮忙,非常感谢



回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容