Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
75
rated 0 times [  76] [ 1]  / answers: 1 / hits: 107834  / 15 Years ago, fri, october 9, 2009, 12:00:00

How do I remove the 'bounds_changed' Event listener in Google Maps API v3?



google.maps.event.removeListener(_???_);    

More From » google-maps

 Answers
17

Usually you can find answers to such questions in Google Maps API documentation.



As Andrew said, addListener returns a handle which you can use later to remove the listener. That's because a single event can have many listeners and to remove them you must save a reference to each of attached listeners.



There's also a function which removes all of the listeners at the same time:



clearListeners(instance:Object, eventName:string);
//In your case:
google.maps.event.clearListeners(map, 'bounds_changed');


Here's the Google Maps API reference where you can read about it.


[#98540] Monday, October 5, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adrianobeds

Total Points: 558
Total Questions: 118
Total Answers: 116

Location: Luxembourg
Member since Tue, Jan 25, 2022
2 Years ago
;