1

I am using google maps API to get coordinates from a typed location. What I was also hoping to do was get the radius of the place, possibly using "bounds".

For example, if I geocode "England" it gives me a coordinate, but it doesnt tell me it's radius is very large. Whereas if I geocode "London" it again gives me a coordinate but doesnt tell me that it's radius is much smaller.

So my question is, is it possible to get an estimate of the size of the area being geocoded from the google API as well as it's center coordinate point?

Thanks!

Kara
  • 6,115
  • 16
  • 50
  • 57
Jimmy
  • 12,087
  • 28
  • 102
  • 192
  • possible duplicate of [zoom in google maps API - different for city vs country](http://stackoverflow.com/questions/11336876/zoom-in-google-maps-api-different-for-city-vs-country) – geocodezip May 28 '13 at 12:53
  • The thing is I want the value in a number, miles or km for example. None of the answers do this, they only deal with zoom – Jimmy May 28 '13 at 14:43

1 Answers1

1

You should be able to get the bounds via the GeocoderResult's geometry.bounds or geometry.viewport properties.

https://developers.google.com/maps/documentation/javascript/reference#GeocoderGeometry

duncan
  • 31,401
  • 13
  • 78
  • 99
  • Will that give me a distance in miles or km? – Jimmy May 28 '13 at 13:34
  • No. If you want to convert coordinates (such as for your LatLngBounds) you can use the DistanceMatrixService - https://developers.google.com/maps/documentation/javascript/reference#DistanceMatrixService – duncan May 28 '13 at 15:08