create a GLatLngBounds object that encompasses your points (eg by repeated calls to .extend() )
Then use GMap2.getBoundsZoomLevel() to get a suitable zoom level. http://code.google.com/apis/maps/documentation/reference.html#GMap2.getBoundsZoomLevel getCenter() of the bounds object is useful too. Then center and zoom the map to the values you have. 2009/8/31 Pcar <[email protected]>: > > Is there a way to determine the best zoom (Closest to map) based on > the markers that are plotted on the map. So I want to make it zoomed > in a close as possible with making all markers visible without > panning. > > I imagine you can just take the distance to the farthest marker from > center and then create a mapping of distances/zoom levels. I was just > wondering if there is an easier way. > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
