addEventListener(eventType, listener, thisObject)
Subscribes a listener function to an event type.
Declaration
addEventListener(
eventType: string,
listener: MapKitEventListener,
thisObject?: object | null,
): boolean;Parameters
- type:
The type of event, for example, a
"configuration-change". - listener:
The callback function to invoke. MapKit JS passes
listeneranEventas its sole argument. - thisObject:
An object MapKit JS sets as the
thiskeyword on thelistenerfunction.
Mentioned in
Discussion
Unlike a DOM EventTarget, a MapKitEventTarget doesn’t go through bubbling or capturing phases. The system also interprets the third parameter differently from the DOM’s EventTarget.