自定义气泡为什么出不来呢?
主要注意以下问题:
首先这里的 customCallout 是作为一个属性存在的,那么自然要在 WXML 中有所体现,主要体现在 markers 对象中的数据结构。
customCallout: {
anchorX: 0,
anchorY: 0,
display: "ALWAYS"
}
比如我自己开发过程中使用的对象结构:
marker = {
id: i,
_id: "",
iconPath: '/images/[email protected]',
latitude: "",
longitude: "",
width: 30,
height: 30,
customCallout: {
anchorX: 0,
anchorY: 0,
display: "ALWAYS"
}
}
这里注意使用 cover-view 然后配置 marker-id
当然也可以用数组形式配置
test
数组中存储着所有需要显示的 markers 的 id
注意一定是 number 类型的 id 哈
2020年9月3日