Canada - Highcharts Maps
Highcharts Maps demo
by koh_edwin
HTML
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<div id="container"></div>
CSS
#container {
height: 500px;
min-width: 310px;
max-width: 800px;
margin: 0 auto;
}
.loading {
margin-top: 10em;
text-align: center;
color: gray;
}
JavaScript
(async () => {
const topology = {
type: "Topology",
objects: {
default: {
type: "GeometryCollection",
geometries: [
{
type: "Polygon",
arcs: [[0]],
id: "CA.5682",
properties: {
"hc-group": "admin1",
"hc-middle-x": 0.52,
"hc-key": "ca-5682",
"hc-a2": "NU",
labelrank: "20",
hasc: "-99",
"alt-name": null,
"woe-id": "-99",
subregion: null,
fips: null,
"postal-code": null,
name: null,
country: "Canada",
"type-en": null,
region: null,
longitude: "-61.4664",
"woe-name": null,
latitude: "47.7941",
"woe-label": null,
type: null,
},
},
{
type: "MultiPolygon",
arcs: [
[[1]],
[[2]],
[[3]],
[[4]],
[[5]],
[[6]],
[[7]],
[[8]],
[[9, 10]],
[[11, 12, 13, 14, 15]],
[[16]],
[[17]],
[[18]],
[[19]],
[[20]],
[[21]],
],
id: "CA.BC",
properties: {
"hc-group": "admin1",
"hc-middle-x": 0.53,
"hc-middle-y": 0.54,
"hc-key": "ca-bc",
"hc-a2": "BC",
labelrank: "2",
hasc: "CA.BC",
"alt-name": "Colombie britannique|New Caledonia",
"woe-id": "2344916",
subregion: "British Columbia",
fips: "CA02",
"postal-code": "BC",
name: "British Columbia",
country: "Canada",
"type-en": "Province",
region: "Western Canada",
longitude: "-124.662",
"woe-name": "British Columbia",
latitude: "54.6943",
"woe-label": "British Columbia, CA, Canada",
type: "Province",
},
},
{
type: "MultiPolygon",
arcs: [
[[22, 23, 24, 25],...