bindmarkertap,bindcallouttap 真机无触发事件
wxml 代码
< view class = "page" > < map id = "myMap" class = "mapview" style = "height: {{mapStyle.height}};" longitude = "{{longitude}}" latitude = "{{latitude}}" scale = "{{zoom}}" show-location markers = "{{markers}}" controls = "{{controls}}" bindmarkertap = "markertap" bindcallouttap = "markertap" bindcontroltap = "controltop" /> </ view > |
js 代码
datas.forEach((item, index) => { let point = MapUtil.bd09ToGcj02(item.latitude, item.longitude); temp.push({ id: index, longitude: point.longitude, latitude: point.latitude, name: item.name, callout: { content: item.name, borderRadius: 20, color: '#000000' , fontSize: 12, padding: 10, display: 'ALWAYS' } }); }); this .setData({ markers: datas }) |
markertap(e) { wx.showToast({ title: '测试' + e.markerId }); console.log(e); /** * 打开本地地图界面 */ wx.openLocation({ latitude: this .data.markers[e.markerId].latitude, longitude: this .data.markers[e.markerId].longitude, name: this .data.markers[e.markerId].name }) }, |
模拟器上点击marker,气泡都能正常触发.
真机预览却没有任何响应. 因为也看不到log,所以也不知道是代码报错?还是bug.
设备 iPhone 6 , 微信版本:6.5.8 基础库版本: 1.2.3
设备 iPhone 5s , 微信版本:6.5.8 基础库版本: 1.2.2