The event is called zoom_changed (NOT zoom_change ). The event handler for this event is called AFTER zooming. In fact, it is not so easy to reveal the change in scale caused by the user from what is caused by the program. A possible solution is to maintain a βglobalβ variable say userZoom , which indicates whether the user has caused scaling.
var userZoom = true; // initial value: be prepared for user action // Install listener google.maps.event.addListener(Map.self, 'zoom_changed', function() { if (userZoom) { // the user changed zoom: do what should be done } else { // zoom change caused by a program action: ignore } userZoom = true; // be prepared for the user zoom action });
Before you invoke any program actions that change the scale, set userZoom = false , for example
userZoom = false; map.setZoom(9);
source share