Interface OnEvents<EventTypes>

Objects that implement this interface will have events connected to the underlying Mapbox control that raises the events defined by the EventTypes generic.

interface OnEvents<EventTypes> {
    on?: {
        [Property in string | number | symbol]?: ((evt) => void) | ((evt) => any)
    };
}

Type Parameters

  • EventTypes

    The types of events.

Hierarchy (view full)

Properties

Properties

on?: {
    [Property in string | number | symbol]?: ((evt) => void) | ((evt) => any)
}

A collection of handlers for events with names defined by the EventTypes generic.

Example

on: {
click: evt => console.log(evt),
drag: evt => console.log(evt)
};