Expand description
Callback-based event subscription for MapState.
Complements the existing poll-based
InteractionManager::drain_events
model with a subscribe/unsubscribe API that mirrors
map.on(type, listener) / map.off(type, listener) from
MapLibre GL JS.
§Thread safety
EventEmitter is Send + Sync because callbacks are stored as
Box<dyn Fn(&InteractionEvent) + Send + Sync>. The emitter is
designed to be called from the same thread that owns MapState
(the update path), so no internal locking is required.
Structs§
- Event
Emitter - Callback-based event subscription system.
- Listener
Id - Opaque handle returned by
EventEmitter::onandEventEmitter::once.