Skip to main content

Events

Map → you: subscribe with map.on(event, handler). Check meta.source === "user" when you only want visitor-driven changes.

map.on() infers payload types from the event name and manages opt-in subscriptions for high-frequency events like camera.changed.

EventWhen
selection.changedBuilding, floor, or room changed
directions.changedRoute started, updated, or cleared
state.changedAny state change — catch-all resync
camera.idleCamera motion finished
expand.requestedVisitor asked to open the full map
const off = map.on("selection.changed", (payload, meta) => {
console.log(payload.room, meta.source);
});
off();

Wire event names

Full catalog in the protocol events reference:

map.ready, map.loaded, map.error, state.changed, selection.changed, directions.changed, expand.requested, camera.changed, camera.idle, camera.pathEnded