I encountered this problem as well. As far as I can tell, you have to get the proper zoom value inside your zoom_changed event listener.
I got around that by setting a flag value then adding my markers and calling fitBounds. Inside my zoom_changed listener, if the flag value was set, I reset it then called another function to continue processing. Hope that helps, Chad Killingsworth On Jan 11, 9:52 pm, fly2279 <[email protected]> wrote: > I am placing markers on the map in a loop and extending the bounds of > the map to fit the markers. When I use getZoom() to get the zoom level > after fitting the bounds it's the same as the initial value for the > map. My initial zoom value is set to 8 and that's what's returned > after fitting the bounds. I placed a listener on zoom_changed and > getZoom() returns 10 after fitting the bounds. How do I get the zoom > level after fitting the bounds since calling getZoom() immediately > after doesn't seem to return the correct value?
-- 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.
