问题
How do I tell the google map event "bounds_change" to only work when the map is initially loaded, and not after user change?
回答1:
from the documentation
addListenerOnce(instance:Object, eventName:string, handler:function(?))
Return Value: MapsEventListener Like addListener, but the handler removes itself after handling the first event.
google.maps.event.addListenerOnce(map,'bounds_changed', function() {});
来源:https://stackoverflow.com/questions/30601828/how-to-execute-google-maps-event-bounds-changed-only-once