event class
google.maps.event
class
Namespace for all public event functions
Access by calling const {event} = await google.maps.importLibrary("core")
.
See Libraries in the Maps JavaScript API.
Static Methods | |
---|---|
addListener |
addListener(instance, eventName, handler) Return Value:
MapsEventListener Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener(). |
addListenerOnce |
addListenerOnce(instance, eventName, handler) Return Value:
MapsEventListener Like addListener, but the handler removes itself after handling the first event. |
clearInstanceListeners |
clearInstanceListeners(instance) Parameters:
Return Value:
void Removes all listeners for all events for the given instance. |
clearListeners |
clearListeners(instance, eventName) Parameters:
Return Value:
void Removes all listeners for the given event for the given instance. |
hasListeners |
hasListeners(instance, eventName) Parameters:
Return Value:
boolean Returns if there are listeners for the given event on the given instance. Can be used to save the computation of expensive event details. |
removeListener |
removeListener(listener) Parameters:
Return Value:
void Removes the given listener, which should have been returned by addListener above. Equivalent to calling listener.remove() . |
trigger |
trigger(instance, eventName, eventArgs) Parameters:
Return Value:
void Triggers the given event. All arguments after eventName are passed as arguments to the listeners. |
|
addDomListener(instance, eventName, handler[, capture]) Return Value:
MapsEventListener Cross browser event handler registration. This listener is removed by calling removeListener(handle) for the handle that is returned by this function. |
|
addDomListenerOnce(instance, eventName, handler[, capture]) Parameters:
|