Reputation: 565
google.maps.event.addListener(map, 'bounds_changed', alert("say sth"))
only works for the 1st time the map is loaded. After that, no matter how I dragged the map or zoomed the map, the alert didn't pop up.
Same did google.maps.event.addListener(map, 'idle', alert("just pop twice!"))
.
Upvotes: 0
Views: 1167
Reputation: 117354
wrap the alert into a function:
google.maps.event.addListener(map, 'idle', function(){alert("just pop twice!")})
Upvotes: 1