map控件里label和callout同时使用,点击market,callout会同时出现两个。
你好,麻烦提供下代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html?search-key=%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5)
js:
latitude: 40.069,
longitude: 116.129,
markers: [{
id: 382712,
latitude: 40.07103,
longitude: 116.12672,
iconPath: ‘/image/zhfw.png’,
width: 16,
height: 16,
label: { content: ‘安云影像’, color: ‘#db5712’, x: -16, y: 6, fontSize: 8 },
callout: { content: ‘去逛逛’, color: ‘#db5712’, display: ‘BYCLICK’, borderRadius: 5, fontSize: 8, display: ‘BYCLICK’ },
anchor: { x: .5, y: .5 }
},
{
id: 382715,
latitude: 40.071445,
longitude: 116.12731,
iconPath: ‘/image/mscy.png’,
width: 16,
height: 16,
label: { content: ‘安河家园小\n顾披萨外卖’, color: ‘#db1296’, x: -16, y: 6, fontSize: 8 },
callout: { content: ‘去逛逛’, color: ‘#db1296’, display: ‘BYCLICK’, borderRadius: 5, fontSize: 8, display: ‘BYCLICK’ },
anchor: { x: .5, y: .5 }
}
],
wxml:
<map
id=“myMap”
style=“width: 100%; height: 100%;”
latitude="{{latitude}}"
longitude="{{longitude}}"
markers="{{markers}}"
circles="{{circles}}"
scale = “17”
bindmarkertap=“markertap”
bindcallouttap = “bindcallouttap”
bindtap=“bindtap”
show-location
></map>