hc-key to iso conversion
Posted: Sun Dec 02, 2018 10:45 pm
by 500internalerrors
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!
Re: hc-key to iso conversion
Posted: Mon Dec 03, 2018 5:49 pm
by rafalS
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!
Re: hc-key to iso conversion
Posted: Mon Dec 03, 2018 9:24 pm
by 500internalerrors
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)?
Re: hc-key to iso conversion
Posted: Tue Dec 04, 2018 5:53 pm
by rafalS
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!