500internalerrors
Posts: 6
Joined: Wed Oct 10, 2018 10:47 am

hc-key to iso conversion

Sun Dec 02, 2018 10:45 pm

Hi all,

it is mentioned in https://www.highcharts.com/docs/maps/map-collection:
As an example, most countries are identified by their two letter ISO-3166 code.
Is there a table for which countries this is not the case? Or a save way to do the conversion?

Thanks!

rafalS
Posts: 664
Joined: Thu Jun 14, 2018 11:40 am

Re: hc-key to iso conversion

Mon Dec 03, 2018 5:49 pm

Hi, 500internalerrors,

ISO 3166 is an official standard and you can find all countries codes here: https://en.wikipedia.org/wiki/ISO_3166-1
If you are looking for something else, could you specify your question?

Best regards!
Rafal Sebestjanski,
Highcharts Developer

500internalerrors
Posts: 6
Joined: Wed Oct 10, 2018 10:47 am

Re: hc-key to iso conversion

Mon Dec 03, 2018 9:24 pm

Hi Rafal Sebestjanski,

my problem is, that the documentary states that most of the hc-key are identical to the iso code. That implies that it's not the case for all countries.
The question is: for which countries these keys are not the same? So when hc-key = iso-a2-key.toLowerCase() will fail?
And is there maybe a built-in function to do the conversion like: hc-key = highcharts.conversion_from_iso_to_hc(iso-a2-key)?

rafalS
Posts: 664
Joined: Thu Jun 14, 2018 11:40 am

Re: hc-key to iso conversion

Tue Dec 04, 2018 5:53 pm

For countries that... are not actually countries.

Take Bermuda for example: https://en.wikipedia.org/wiki/Bermuda
It's a British overseas territory and not an independent country, but it's a separate territory with its own iso-3166 code. Bermuda doesn't have hc-key.

Another example is Cyprus No Mans Area that has its own hc-key, but doesn't have iso-3166 code.

Here you have our map with countries where hc-key is the same like iso-a2 and with 15 "countries" that have no its own hc-key: https://jsfiddle.net/BlackLabel/5fvky3hj/

Best regards!
Rafal Sebestjanski,
Highcharts Developer

Return to “Highmaps Usage”