代码片段https://developers.weixin.qq.com/s/txEZrRm375MO
map组件polylinetap事件无效map组件polylinetap事件无效。。。社区有人提过,好像没有修复
2023-11-20无效啊这个api,文档大家都看了
小程序基础库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事件,但是点击路线并不会触发事件函数!!!
2023-11-20同样无效
map组件bindpolylinetap事件不生效<map id="myMap" style="width: 100%; height: 600px;" latitude="{{latitude}}" longitude="{{longitude}}" show-location polyline="{{polylines}}" bindpolylinetap="handlePolylineTap" scale="16" ></map> addPolylines() { const polylines = [{ arrowLine: true, width: 11, borderColor: "#17872F", borderWidth: 3, color: "#00B85F", points: [ { latitude: 34.25789, longitude: 108.945738 }, { latitude: 34.25721100000001, longitude: 108.946958 }, { latitude: 34.250070000000015, longitude: 108.94619899999996 }, { latitude: 34.250873999999996, longitude: 108.91304399999997 } ] }] this.setData({ polylines }) this.mapCtx.moveToLocation() }, // 点击地图路线时触发 handlePolylineTap(e) { console.log(e, 'e') },
2023-11-20