Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give different color to each country in google map

Does anyone know how to give a different color to each country in a google map?

e.g:

in the world map

Blue overlay to UK, then RED china...etc

I wonder if google provide API to give color to each country

Thanks

like image 555
adhitia hidayat Avatar asked Apr 18 '11 04:04

adhitia hidayat


1 Answers

Using Google Maps this is really not easy, as @oezi said you would need to build overlays of every country you want to color, which frankly sounds like a mess.

But if you don't need all of the functionalities of Google Maps, perhaps you can use a Map Chart from the fantastic Google Chart Tools (aka Chart API). You can check and tinker with a working example of a Colored Map (among some others) in the interactive Chart Wizard

2017 UPDATE: This answer is quite old and as such the Map Charts API has been deprecated by Google. You can use the Geocharts from the Google Charts API instead:

https://developers.google.com/chart/interactive/docs/gallery/geochart

Hope this helps!

like image 55
danii Avatar answered Sep 29 '22 12:09

danii