0

I got a google map URL. In my apps I use gmaps js library

What I want is, how to the gmaps js could show the exactly same what is google maps shown.

I tried to send the parameter data :

data=!4m5!3m4!1s0x2d8809c9659a2d3d:0x436e33fd8cdb6299!8m2!3d-1.4300254!4d121.4456179 from gmaps library, but did not worked.

could someone please tell me how to get the polygons from google maps url?

xomena
  • 31,125
  • 6
  • 88
  • 117
vian qu
  • 21
  • 4

1 Answers1

1

Currently Google Maps JavaScript API doesn't expose any boundaries of geographic features. There is very old feature request in the public issue tracker to add this functionality, however it looks like Google didn't set high priority on this:

https://issuetracker.google.com/issues/35816953

You can star the public feature request to add your vote and subscribe to notifications.

Also, you can find a workaround to get polygons from other sources and add them to Google maps as additional layers.

The nice workaround to get polygons in GeoJSON format from OSM is described in the following answer:

https://stackoverflow.com/a/40172098/5140781

So, if you download the GeoJSON you will be able to add it to map using the data layer and its loadGeoJson() method:

https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson

As I can see the gmaps.js supports GeoJSON polygons as well:

https://hpneo.github.io/gmaps/examples/geojson_polygon.html

I hope this helps!

xomena
  • 31,125
  • 6
  • 88
  • 117
  • hii xomena, for boundaries of geographic features i used polygon, draw it manualy using polygon (data layer). thankyou for answered – vian qu Jul 16 '17 at 14:41