Reputation: 925
How can i remove listener but first to check if that listener exists?
var listener1 = google.maps.event.addListener(markerR, 'click', function
(m) {
if(exist)
google.maps.event.clearListeners(listener1);
});
Upvotes: 0
Views: 2588
Reputation: 92
I dont think there is a way to check if an EventListenner exists in js. All though you can make a variabel and save to this everytime you add an EventListener.
Upvotes: 2
Reputation: 49
You should be able to like
if(element.hasOwnProperty('onclick'))...
Upvotes: 0