首页 > 解决方案 > Highmaps - 如何从西班牙突出显示加那利群岛

问题描述

我正在使用带有自定义世界地图数据的高地图。在我的示例中仅突出显示了西班牙。但是,当您将鼠标悬停在西班牙国家/地区时,非洲北部的一些岛屿也会突出显示。我怀疑这些是加那利群岛。如何防止这些岛屿被突出显示?示例: http ://bastionstudio.co.za/test/spain.html

标签: highcharts

解决方案


可以通过推送西班牙的新坐标来解决。 http://bastionstudio.co.za/test/spain-no-canary-islands.html

console.log(Highcharts.maps['custom/world'].features);

Highcharts.maps['custom/world'].features.push({
   "type":"Feature",
   "id":"ES",
   "properties": {
          "hc-group":"admin0",
          "hc-middle-x":0.76,
          "hc-middle-y":0.27,
          "hc-key":"es",
          "hc-a2":"ES","name":"Spain",
          "labelrank":"2",
          "country-abbrev":"Sp.",
          "subregion":"Southern Europe",
          "region-wb":"Europe & Central Asia",
          "iso-a3":"ESP","iso-a2":"ES","woe-id":"23424950",
          "continent":"Europe"
    },
    "geometry":{
       "type":"MultiPolygon",
       "coordinates":[
    [
     [
      [4045, 7594],
      [4021, 7599],
      [4011, 7621],
      [3984, 7629],
      [3997, 7692],
      [3998, 7762],
      [4020, 7781],
      [4009, 7795],
      [3944, 7795],
      [3930, 7838],
      [3969, 7860],
      [3988, 7852],
      [4098, 7851],
      [4151, 7846],
      [4203, 7821],
      [4246, 7818],
      [4249, 7812],
      [4255, 7814],
      [4262, 7812],
      [4262, 7813],
      [4262, 7814],
      [4263, 7812],
      [4263, 7812],
      [4279, 7808],
      [4298, 7812],
      [4300, 7795],
      [4265, 7771],
      [4233, 7763],
      [4194, 7709],
      [4211, 7683],
      [4189, 7669],
      [4183, 7644],
      [4154, 7635],
      [4143, 7615],
      [4072, 7613],
      [4046, 7594],
      [4045, 7594]
     ]
    ]
   ]
   }
});


推荐阅读