ktstyle
Posts: 33
Joined: Tue May 05, 2020 11:48 pm

How to get x & y coordinates for world map countries

Hello,

I'm attempting to add pin marks on countries such as Finland, Norway and Ireland. I have the x & y coordinates for these countries when the map is only showing Europe for example https://jsfiddle.net/BlackLabel/2ekujmpb/ but i'd like to achieve this same look on a world map. Because the map is larger, the pin markers are way off from the countries. How can I get the x & y coordinates for these countries and other countries in the future?

Here is the jsfiddle with the world map and pin locations off mark: https://jsfiddle.net/nxyj9k58/

Also, I would like to make these countries re-direct another link when clicked on. For example clicking on the country Ireland re-directs to google.com. How can this be achieved?

Thank you,

Best
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: How to get x & y coordinates for world map countries

Hello ktstyle,

Thanks for contacting us with your questions.

Coordinates of a specific country or area you can find in the file containing map data, https://code.highcharts.com/mapdata/custom/world.js in this case. Look for 'coordinates' key of a specific country and you should find all informations that you need.

When it comes to your second questions, should the redirection happen when you click a country zone or a pin? Thanks in advance for a clarification on this one.

Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Maps”