Adds an event listener to handle events triggered by user interactions and the framework.
- MapKit JS 5.0+
The event type of interest (e.g., "select").
The callback function to invoke. Listener is passed a
mapkitevent as its sole argument.
An object to be set as the
thiskeyword on the listener function.
This method does not return a value.
listener as a callback for an event of type
type. Throws an error if
type is invalid. See Handling Map Events for a list of event types.
The following is an example of adding an event listener for a region change: