Search code examples
google-mapsdrawshapesarearegion

Google Maps draw area / shape / region and export as latitude longitude


I need a Google Map with marked up areas with different colors.

GADM data

The first article I came across was this one: https://ourcodeworld.com/articles/read/830/how-to-highlight-an-area-city-state-or-country-in-google-maps-with-javascript

It links to this service for getting coordinates: https://gadm.org/download_country_v3.html

The problem is that there are too many points so it would end up with 3MB for an embedded map.

Google Maps draw

Then I tried Google Maps service to draw a shape. While it works, I could not find any export function to get the longitude and latitude.

https://www.google.com/maps/d/u/0/viewer?mid=1IlydZDXB-tkN8K8pAR57BRFqBOTv3c8z&ll=59.681023024095936%2C18.40997752499993&z=9

Question

How can I draw an area on a map and then get longitude and latitude for the points? On Google Maps, a tool or something else does not matter.


Solution

  • I solved my problem very differently. I simply used an svg file of just the country and highlighted areas there.

    I used this site: https://simplemaps.com/custom/country