On Apr 3, 9:54 pm, vince <[email protected]> wrote: > I'm currently letting users define their own boundaries for places > (e.g.http://socialect.com/places/1411). I then output the polygon as > a kml file (e.g.http://socialect.com/assemblies/1411/boundary.kml) > which I add as an overlay. > > My question is, how can I set the zoom level of the map so that it > properly shows the full boundary? Create a GLatLngBounds out of > GPolygon or GGeoXml maybe?
GPolygon has a .getBounds() method. GGeoXml has a getDefaultBounds() method. http://code.google.com/apis/maps/documentation/reference.html#GGeoXml.getDefaultBounds You can auto zoom and center the map to fit a bounds with: map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds)); -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
