On Apr 10, 3:12 pm, "[email protected]" <[email protected]> wrote: > On Apr 10, 1:55 pm, knospe <[email protected]> wrote: > > > What do I have to do to auto-fill the zoom and the center > > according to the coords of the polygon? > > The most general way: > 1. create google.maps.LatLngBounds object that contains the bounds > of the polygon. > 2. call map.fitBounds with that bounds object as its argument. > > If you actually need the center and zoom level being used, you can > get that by calling map.getCenter() and map.getZoom() after the > bounds has taken effect.
Here is an example (probably not the simplest): http://www.geocodezip.com/v3_polygon_example_clickable_squares.html (click on the links in the table on the side to center and zoom on the specified square) -- Larry -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
