const START_MARKER_ID = 99;
const markers = useMemo(() => {
const markers = data
.map((item, index) => {
const id = index + 1 + START_MARKER_ID;
return {
id,
latitude: item.latitude,
longitude: item.longitude,
width: 42,
height: 52
joinCluster: true,
callout: {
content: `${item.name}`,
fontSize: 12,
width: 20,
height: 20,
padding: 10,
bgColor: "#1a66ff",
color: "#FFF",
borderRadius: 10,
borderWidth: 1,
borderColor: "#1a66ff",
textAlign: "center",
anchorX: 0,
anchorY: 0,
display: "ALWAYS",
},
};
});
return markers;
}, [data]);
const handleCallOutTap = (e: CommonEvent) => {
const markerId = e.detail.markerId;
console.log(e);
};
const handleMapTap = () => {
};
return (
null}
/>
);
- ios机型没问题,Android手机出问题很频繁,bindcallouttap的事件e.detail.markerId为空。
- 如果配置joinCluster: false,Android手机bindcallouttap的事件e.detail.markerId正常。
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)