Feature type surfaced by user interaction handlers.
Module configuration type passed to config-change handlers.
Data type passed to shown-features handlers. Use never for
modules that have no show method.
Module-specific scope object accepted by where, in addition to a
feature predicate. never for modules that only support predicates. Unrelated to a module's
named scopes, which are properties on this object rather than an argument to it.
Feature type surfaced by user interaction handlers.
Module configuration type passed to config-change handlers.
Data type passed to shown-features handlers. Use never for
modules that have no show method.
Module-specific scope object accepted by where, in addition to a
feature predicate. never for modules that only support predicates. Unrelated to a module's
named scopes, which are properties on this object rather than an argument to it.
Remove all handlers for the given event type at once.
Accepts both user interaction types (click, contextmenu, hover, long-hover) and
module lifecycle types (config-change, shown-features).
Prefer the unsubscribe function returned by on when you need to remove a single
handler. Use off for bulk teardown — e.g. when unmounting a component that registered
multiple handlers of the same type.
The event type whose handlers should all be cleared.
Subscribe to a user interaction event (click, contextmenu, hover, 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.
Subscribe to config-change events.
Fires after any configuration mutation — applyConfig, setVisible, or any
module-specific setter. The handler receives the module's full updated configuration.
'config-change'
Receives the module's config (or undefined when config is cleared).
An unsubscribe function. Call it to remove only this handler.
Subscribe to shown-features events.
Fires immediately after the module's show() method (or equivalent) has rendered
new data on the map. Only available on modules that have a show method.
'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 — see UserEvents.where.
See EventScope — a predicate over this module's feature type, or, where
the module supports one, a scope object such as { layerGroups } on BaseMapModule.
Optionalconfig: EventHandlerCursorConfig
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.
Unified events interface that blends user interaction events and module lifecycle events under a single
on/offsurface.User event types (
click,contextmenu,hover,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. Both user and module event types are also removable in bulk via off.Named scopes, where a module has them, hang off this object as properties and are themselves
CombinedEvents— so a scope carries the lifecycle events that module actually scopes. where narrows ad hoc instead, and returns a plain UserEvents: a filter you build on the spot has no lifecycle of its own.Example