Search code examples
javascriptgoogle-mapsgoogle-maps-api-3gisgoogle-maps-api-2

Manipulating neighborhood polygons using the Google Maps API?


Google maps does a very good job highliting the neoghborhood boundaries polygons:

enter image description here

The underlying polygon data is very good. It's definitely better than Foursquare's Quattroshapes.

Since I don't think there's a way to extract this data from Google, I thought that maybe it would be possible to show / highlight and manipulate these polygons as first class objects inside Google Maps using the Google Maps Javascript API?

What I would like to do is i.e highlight only a subset of the neighbourhood polygons per city, change their fill colors based on my own data, etc.

Another option would be to get the polygon data from Google and draw the polygons myself, but I'm pretty sure it's not really available. Does anyone know?

Thanks!


Solution

  • Unfortunately, you cannot get the information directly through the JavaScript API. If you can find KML data online (or make some yourself), it can be loaded through google.maps.KmlLayer.

    It is pretty easy to make KML layers in Google Earth. So if you only need 1 city, it may be a good time investment to make.