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

hc-key to iso conversion

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: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: hc-key to iso conversion

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 Team Lead
500internalerrors
Posts: 9
Joined: Wed Oct 10, 2018 10:47 am

Re: hc-key to iso conversion

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: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: hc-key to iso conversion

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 Team Lead

Return to “Highcharts Maps”