---
title: "addEventListener(eventType, listener, thisObject)"
framework: mapkitjs
role: symbol
role_heading: Instance Method
path: mapkitjs/mapkiteventtarget/addeventlistener
---

# addEventListener(eventType, listener, thisObject)

Subscribes a listener function to an event type.

## Declaration

```data
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.

## Discussion

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.
