Singleton constructor. Returns existing instance if already created.
Button associated with this state.
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 length measurement mode. Disables info box, binds button handler for exit, installs picking logic, and opens the measurement info window.
Application reference.
Exits length measurement mode, restoring info box, button handler, cleaning up geometry, closing window, removing event listeners.
Always true.
Deregisters all relevant event handlers for this state.
Cleans up previously drawn line measurement geometry from the viewer and state.
Sets up the picking event: left-clicking on a feature attempts to load and display the associated line/length tileset.
LengthMeasurementState – App UI state for interactive building/line length measurement.
Ensures singleton pattern (only one active at a time). Manages button UI, info window, event registration for picking and loading associated line/length data from remote 3D tilesets. Handles proper measurement cleanup, state transitions, and deactivation workflow.
Param: button
The button element that activates this measurement state.
Static
instance - Singleton instance reference.
Example