I tried to add some listeners for Info Window like:
//works
google.maps.event.addListener(markerInfoWindow, "closeclick", function()
{
console.log('trigger close');
});
//doesn't work
google.maps.event.addListener(markerInfoWindow, "click", function()
{
console.log('trigger close');
});
Is there a list of events for infoWindow in documentation I missed or is there another way to make things done?
Actually the problem is that I want to create an event listener to close infoWindow on mouseout
google.maps.event.addListener(markerInfoWindow, 'mouseout', function(){
console.log('trigger close');
self._setInfoWndClosed();
});
the self._setInfoWndClosed()
is working correctly in context of closeclick
event. And I end up finding out that actually listener doesn't work itself.
There is no documented "click" or "mouseover" event for an InfoWindow: The only documented events on an google.maps.InfoWindow (at present) are:
Events
closeclick Arguments: None
This event is fired when the close button was clicked.
content_changed Arguments: None
This event is fired when the content property changes.
domready Arguments: None
This event is fired when the containing the InfoWindow's content is attached to the DOM. You may wish to monitor this event if you are building out your info window content dynamically.
position_changed Arguments: None
This event is fired when the position property changes.
zindex_changed Arguments: None
This event is fired when the InfoWindow's zIndex changes.
You can add listeners for "click" and "mouseover" events on the content of the InfoWindow.