Feature type that user interaction handlers receive.
Module configuration type passed to config-change handlers.
Data type passed to shown-features handlers. Use never for
modules that have no show method.
The module-specific scope object where accepts besides a feature
predicate, or never for modules that only support predicates. It is unrelated to a module's
named scopes, which are properties on this object rather than an argument to it.
Feature type that user interaction handlers receive.
Module configuration type passed to config-change handlers.
Data type passed to shown-features handlers. Use never for
modules that have no show method.
The module-specific scope object where accepts besides a feature
predicate, or never for modules that only support predicates. It is unrelated to a module's
named scopes, which are properties on this object rather than an argument to it.
Removes all handlers for the given event type at once.
It accepts both user interaction types (click, contextmenu, hover, hover-move, long-hover) and
module lifecycle types (config-change, and shown-features on a module that has a show method).
To remove a single handler, call the unsubscribe function that on returns instead.
Use off for bulk teardown, for example when unmounting a component that registered
several handlers of the same type.
The event type whose handlers should all be cleared.
Subscribes to a user interaction event (click, contextmenu, hover, hover-move, long-hover).
The user event type.
Called with the feature, click/hover coordinates, all features at the point, and the source configuration.
An unsubscribe function. Call it to remove only this handler.
Subscribes to config-change events.
It fires after applyConfig, setVisible or any module-specific setter changes the
configuration. The handler receives the module's full updated configuration.
'config-change'
Receives the module's config, or undefined when the config is cleared.
An unsubscribe function. Call it to remove only this handler.
Subscribes to shown-features events.
It fires right after the module's show() method, or its equivalent, renders new data on
the map. Only modules that have a show method offer it.
'shown-features'
Receives the data that was passed to show().
An unsubscribe function. Call it to remove only this handler.
Narrows these events to part of what they cover, as UserEvents.where does.
A predicate over this module's feature type or, where the module supports one,
a scope object such as { layerGroups } on BaseMapModule. See EventScope.
Optionalconfig: EventHandlerConfig
Event configuration for handlers registered through the returned instance, so each scope can have its own hover cursor.
A UserEvents covering only the narrowed set. Lifecycle events stay on the module (or named scope) they belong to.
A module's user interaction and lifecycle events under a single
on/offsurface.User event types (
click,contextmenu,hover,hover-move,long-hover) are handled by the underlying UserEvents instance and removed with off.Module lifecycle event types (
config-change,shown-features) are handled by the underlying ModuleEvents instance. Eachoncall returns an unsubscribe function. off also removes both user and module event types in bulk.Named scopes, where a module has them, hang off this object as properties. Each is a UserEventsWithStates, with user events and event states only, since lifecycle events stay here. where narrows ad hoc instead, and returns a plain UserEvents.
Example