我也遇到了这个问题,IOS一切正常,安卓机就不行!
安卓map组件marker上label标签重合时marker点击失效 并层级错乱label和marker重合时, marker会被label遮盖, 导致marker点击事件失效,点击marker边缘后, marker会强制显示在label的上层,这样label上的文字就消失了。 点击事件不触发的问题和这个issue一样的情况:https://developers.weixin.qq.com/community/develop/doc/0008c8ae86c6a8980df8db64659c00?highLine=marker%2520%25E5%2588%25A0%25E9%2599%25A4 代码片段如下, iconPath是图片,label里的坐标为负数和marker重合时,安卓机上会出现层级问题和marker被覆盖,点击失效问题 [代码]const marker = [][代码][代码]list.forEach((e,index) =>[代码][代码] [代码][代码]marker.push({[代码][代码] [代码][代码]iconPath: [代码][代码]this[代码][代码].getIco(e),[代码][代码] [代码][代码]id: e.ID,[代码][代码] [代码][代码]latitude: e.Lat,[代码][代码] [代码][代码]longitude: e.Lng,[代码][代码] [代码][代码]height: 36,[代码][代码] [代码][代码]width: 25,[代码][代码] [代码][代码]zIndex: index,[代码][代码] [代码][代码]label: {[代码][代码] [代码][代码]fontSize: 12,[代码][代码] [代码][代码]anchorX: -10,[代码][代码] [代码][代码]anchorY: -20,[代码][代码] [代码][代码]content:[代码][代码] e.CapacityRate + [代码][代码]'%'[代码][代码],[代码][代码] [代码][代码]textAlign: [代码][代码]'center'[代码][代码],[代码][代码] [代码][代码]color: [代码][代码]'#FFFFFF'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码])[代码][代码]this[代码][代码].markers = marker;[代码] ios和开发者工具里正常, 安卓不正常 [图片]
2019-08-25