views:

980

answers:

1

I am trying to get the bounds of a map after the zoom has change the zoom_changed event fires after the zoom has changed but before the bounds have been recalculated so is you get_bounds() in the function that first you get the previous bounds not the new bounds

is there any way to fire the event after the bounds have been recalculated?

+2  A: 

From the API documentation:

If you are trying to detect a change in the viewport, be sure to use the specific bounds_changed event rather than constituent zoom_changed and center_changed events. Because the Maps API fires these latter events independently, get_bounds() may not report useful results until after the viewport has authoritatively changed. If you wish to get_bounds() after such an event, be sure to listen to the bounds_changed event instead.

Cannonade