在 AmMap 上是否有跟踪气球点击的方法?
这个似乎可以跟踪 map 上任何地方的点击。
map.addListener("click", handleMapClick);
虽然这没有任何效果。
map.addListener("clickMapObject", handleMapObjectClick);
-
function handleMapClick(event) {
console.log(event);
}
function handleMapObjectClick(event) {
console.log(event);
}
最佳答案
在你的 JSFiddle 中,尝试改变:
dataProvider.images.push({
type: "circle",
width: size,
height: size,
// color: dataItem.color,
longitude: heatmapData[i].lon,
latitude: heatmapData[i].lat,
title: heatmapData[i].country,
value: heatmapData[i].count
});
到:
dataProvider.images.push({
type: "circle",
width: size,
height: size,
// color: dataItem.color,
longitude: heatmapData[i].lon,
latitude: heatmapData[i].lat,
title: heatmapData[i].country,
value: heatmapData[i].count,
selectable: true
});
(请参阅最后一行,添加可选择项)。
这似乎是一个未记录的要求。它由此处的 amcharts 演示提供:http://jsfiddle.net/amcharts/6WVvS/链接到/“记录”在:http://www.amcharts.com/tutorials/interacting-between-javascript-charts-and-javascript-maps/
关于javascript - ammap气球点击事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33285730/