Singleton constructor. Returns existing instance if already created.
The toggling/activation button for this measurement 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.
Activates line measurement mode: disables selection, starts new measurement, removes unfinished measurements, binds events, and opens the info window.
The main application object.
Sets up the main "cancel current measurement" event handler and disables camera change notifications.
The main application instance.
The active measurement instance.
Deactivates line measurement mode: restores selection, finalizes/cancels measurement, cleans up button state, closes window, and removes event listeners.
Always true.
Removes the right-click event handler set for this state.
Installs a right-click event handler to terminate measurement mode when the user right-clicks the viewer.
Ends the measurement state: removes button event listeners, clears global measurement flag, and resets camera-change flag after 1 second.
Always true on proper termination.
LineMeasurementState – App UI state for interactive polyline (distance) measurements in a Cesium viewer.
Ensures singleton behavior: only one active at a time. Manages lifecycle of PolylineMeasurement tools, button handlers, info window display, event listeners, and measurement cleanup. Integrates with the measurement list for UI result management.
Param: button
UI button that activates this state.
Static
instance - Singleton reference.
Example