Skip to content

Interface: BuildingChangePayload

Payload for the buildingChange event.

Fires when the user navigates to a different building inside a multi-building property (e.g. an airport with multiple terminals, or a campus with multiple structures). The iframe dispatches this once per building transition — never on the initial mount and never if the building has not actually changed.

Wire source (live — not PENDING): CHILD_ACTIONS.BUILDING_CHANGE dispatched at useBaseMapDataHandling.js:dispatchBuildingChangeEvent (maps-web, verified 2026-04-29).

Example

ts
import { on } from '@mapsted/maps-js-api';

on('buildingChange', (payload) => {
  console.log('Entered building', payload.buildingId);
  if (payload.previousBuildingId !== null) {
    console.log('Left building', payload.previousBuildingId);
  }
});

Properties

PropertyTypeDescription
buildingIdnumberMapsted building identifier for the building the user has just entered. Always a positive integer (the iframe guard skips null/undefined/zero values so consumers never receive an invalid id here).
previousBuildingIdnumber | nullMapsted building identifier for the building the user just left, or null if no prior building was active (i.e. this is the first building entered in the session). Positive integer when present.