Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Amcharts向下搜索国家/地区,添加可单击的链接_Javascript_Maps_Amcharts - Fatal编程技术网

Javascript Amcharts向下搜索国家/地区,添加可单击的链接

Javascript Amcharts向下搜索国家/地区,添加可单击的链接,javascript,maps,amcharts,Javascript,Maps,Amcharts,向地图添加超链接已在此处解决: 但我想知道,如果我在“深入到国家”示例中向国家内的州或省添加可点击的超链接,我需要更改什么? 例如,如果我要点击中国并查看各省,我将如何使用上述两种方法为中国最南部的省份广西壮族分配URL 该地区的ID为“CN-GX”,可在此文件中找到: 谢谢你的帮助 如链接答案中所示,您可以为PolygonSeries设置urlpropertyField,以便它可以从提供给该系列的数据中应用url。您可以将其与countrySeries(向下钻取的映射)中的done事件处

向地图添加超链接已在此处解决:

但我想知道,如果我在“深入到国家”示例中向国家内的州或省添加可点击的超链接,我需要更改什么?

例如,如果我要点击中国并查看各省,我将如何使用上述两种方法为中国最南部的省份广西壮族分配URL

该地区的ID为“CN-GX”,可在此文件中找到:


谢谢你的帮助

如链接答案中所示,您可以为PolygonSeries设置
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"
      }];
  }
});
显然,您希望在应用程序中使其更加健壮,但您已经明白了