在地图上添加超链接已在此处解决:amcharts drill-down map countries clickable
但是我想知道如果要在“追溯至国家/地区”示例中将可点击的超链接添加到国家/地区内的州或省,该怎么做?https://www.amcharts.com/demos/drill-down-to-countries/
例如,如果我单击中国并查看各省,如何使用上述两种方法将URL分配到其最南部的省份广西壮族?
该区域的ID为“ CN-GX”,可以在此文件中找到:https://github.com/amcharts/amcharts4-geodata/blob/master/dist/es2015/chinaHigh.js
感谢您的帮助!
url
propertyField,以便它可以应用提供给系列的数据中的URL。您可以将其与countrySeries中的done
事件处理程序(向下钻取的地图)结合使用,以基于加载的地理数据URL的所需信息填充系列数据。例如:countrySeries.mapPolygons.template.propertyFields.url = "url";
countrySeries.geodataSource.events.on("done", function(ev) {
worldSeries.hide();
countrySeries.show();
if (ev.target.url.indexOf('china') != -1) {
countrySeries.data = [{
id: "CN-GX",
url: "https://en.wikipedia.org/wiki/Guangxi"
}];
}
});