map组件中 bindregionchange 无限触发
wxml:
< map latitude = "{{latitude}}" longitude = "{{longitude}}" scale = "{{buildlData[isSelectedBuildType].scale+2}}" bindcontroltap = "controltap" markers = "{{buildlData[isSelectedBuildType].data}}" bindmarkertap = "markertap" bindregionchange = "regionchange" include-points = "{{buildlData[isSelectedBuildType].data}}" show-location = "{{islocation? 'true': 'false'}}" controls = "{{controls}}" style = "width: auto; height:{{fullscreen ? 89 : 48}}vh;background-color: #fff;" > </ map > <!-- 地图 --> |
js:
regionchange(e) { //console.log(e.type) //if (!this.data.fullscreen) { if (e.type == "end" ){ this .setData({ fullscreen: ! this .data.fullscreen }) if ( this .data.fullscreen) { this .setControls( this .data.windowWidth, this .data.windowHeight - 54) this .setData({ clickchar: "⇑" }) } else { this .setControls( this .data.windowWidth, this .data.windowHeight / 2) this .setData({ clickchar: "⇓" }) } //移动地图事件 // }*/ } |
代码的大意是移动地图就改变是否全屏的状态
在电脑上测试没有问题
但是到手机上就循环触发事件
代码没有改变经纬度的值
不知道为什么