arcee123
arcee123

Reputation: 243

how to execute google maps event "bounds_changed" only once

How do I tell the google map event "bounds_change" to only work when the map is initially loaded, and not after user change?

Upvotes: 1

Views: 2522

Answers (1)

geocodezip
geocodezip

Reputation: 161384

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() {});

Upvotes: 5

Related Questions