在AmMap上是否有跟踪气球点击的方法?
这个似乎跟踪点击地图上的任何地方
map.addListener("click", handleMapClick);
map.addListener("clickMapObject", handleMapObjectClick);
function handleMapClick(event) {
console.log(event);
}
function handleMapObjectClick(event) {
console.log(event);
}
http://jsfiddle.net/vfnw9mxx/在您的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
});
(参见,最后一行,添加selectable)。
这似乎是一个未记录的需求。它在amcharts演示中提供:http://jsfiddle.net/amcharts/6WVvS/链接到/"documented"网址:http://www.amcharts.com/tutorials/interacting-between-javascript-charts-and-javascript-maps/