Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to highlight a region on Google Maps

How can I highlight/cover a region or multiple regions with different colors (for example 3 US states), using google maps polygon arrays? I found a tuto on google code about how to draw a polygon but it's not giving detailed information.

Thank you for your help.

like image 325
Sam Avatar asked Jun 21 '11 20:06

Sam


1 Answers

This documentation on Google is about as straight forward as you can get.

http://code.google.com/apis/maps/documentation/javascript/overlays.html

View the source of this page. Copy and paste the code into your own page and start from there.

http://code.google.com/apis/maps/documentation/javascript/examples/polygon-simple.html

In the example above you simply need to make more than one instance of bermudaTriangle and name it something else and add it to the map.

like image 94
Caimen Avatar answered Sep 27 '22 22:09

Caimen