Singleton constructor. Returns existing instance if already created.
Reference to the measurement activation button.
Required/precondition states.
States that are deactivated when this state activates.
Name/identifier for the state.
States that should be restored when this state ends.
Enters area measurement mode: hides infobox, configures button state/callback, and opens info window. Binds click to remove this state, and sets up left-click building area handler.
Viewer/app reference.
Restores UI and event state after area measurement mode is exited.
Removes all event handlers for this state.
Removes current area measurement primitive from Cesium scene and disables it in Temporary registry.
Sets up input action handler for left-click to trigger area measurement on picked building. Loads the relevant building area tileset for the picked feature if available.
AreaMeasurementState – App state for interactive building/area measurement in a Cesium/3D viewer.
Ensures only one AreaMeasurementState instance is active (singleton), manages UI buttons, click event binding, and toggles a dedicated measurement info window. On user interaction, loads the relevant building area 3D tiles and displays them on demand.
Param: button
The UI button element that triggers this measurement mode.
Static
instance - Ensures singleton behavior.
Example