Reputation: 5461
I am using google maps + javascript + php in my application.
I want to know two things:
In google maps,
does moveend event ALWAYS gets fired AFTER zoomend/dragend (whichever of two) event occurs.
When I click zoom icon on google map or scroll the mouse wheel to zoom, the zoomend event gets fired more than once. If I zoom in one step using + icon on map, the zoomend event gets fired twice or sometimes more. any possible loophole.
And so want to know how to stop further event propogation in javascript. (remember I need not use clearListeners as it will forever ignore event handler which is undesirable).
Thank you.
Upvotes: 0
Views: 1052
Reputation: 15824
I set up listeners for 'moveend', 'zoomend', and 'dragend' to try it out.
GEvent.addListener(map, "moveend", function() { console.log('moveend'); });
GEvent.addListener(map, "zoomend", function() { console.log('zoomend'); });
GEvent.addListener(map, "dragend", function() { console.log('dragend'); });
It appears that 'moveend' always fires after 'zoomend' or 'dragend'.
However, no events ever fired more than once at a time. Maybe you accidentally set up two simultaneous listeners. You shouldn't need to use stopPropagation or cancelBubble.
Upvotes: 1
Reputation: 466
you could try just reuturning false or null from the event. If that doesn't work trying using "event.cancelBubble = true" or "event.stopPropagation"
Upvotes: 1