收藏
回答

小程序基础库3.1.0更新map组件新增polylinetap事件,但开发者工具试了不生效,怎么了?

官方更新链接:https://developers.weixin.qq.com/community/develop/doc/000e6ae75dcfd0a26250579b066001?highLine=polylinetap


<map id='myMap'
     class="map"
     latitude="{{latitude}}"
     longitude="{{longitude}}"
     scale="{{scale}}"
     enable-3D="{{is3D}}"
     enable-traffic="{{isRealTraffic}}"
     enable-poi="{{isShowPoi}}"
     polyline="{{polyline}}"
     markers="{{markers}}"
     bindpolylinetap="onPolylineTap"
     bindmarkertap="onTapMarker"
     bindcallouttap="onTapMapCallOut">
</map>


Page({
  onPolylineTap(event){
    console.log("onPolylineTap:", event)
  },
  onTapMarker(event) {
    console.log('onTapMarker, event:', event)
  },
  onTapMapCallOut(event) {
    console.log('click map callout, event:', event)
  },
})


如上代码,<map/>组件绑定了了onPolylineTap事件,但是点击路线并不会触发事件函数!!!


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

3 个回答

登录 后发表内容