Contents

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 listener an Event as its sole argument.

  • thisObject:

    An object MapKit JS sets as the this keyword on the listener function.

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.