Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I highlight/select different regions on google map?

I was trying to mark regions on google map for a city (for a small utility webapp, that I am writing). However, when I looked up areas by their name, I noticed something new. There is an outline around the areas. Like this(if you search for: "Koregaon Park, Pune, Maharashtra"):

enter image description here

  • Is there a way I can extract all these regions for a given city (in this case, Pune, India) ?
  • Can I add my own regions or edit regions as per my needs ?
  • In the end, I'd like the user to be able to select multiple regions and I'd like to collect that info, in an array or some other data structure ?

Can someone point me in the right direction on how to do this ?

PS: This is limited to a city for now, and the number of regions that I'm targeting are small in number(say around 10. This number will grow if my experiment proves out to be efficient).

Please dont downvote this. If you need me to provide more info, please do let me know.

like image 785
brainydexter Avatar asked Jul 05 '13 20:07

brainydexter


1 Answers

You are asking how to display polygons for your cities on a Google Maps API map.

There are at least 3 ways to do that, but for all those you need the coordinates of the polygon.

  1. KmlLayer - need the data as publicly available KML
  2. FusionTablesLayer - if you have the data as KML you can import it into a FusionTable, if it is a .shp file you can use shpescape.com to import it into FusionTables
  3. You can display the polygons as native Google Maps API v3 polygons

There is publicly available KML data in the Natural Earth Data set (which is available in FusionTables) and at http://www.gadm.org/

like image 104
geocodezip Avatar answered Sep 30 '22 20:09

geocodezip