Optional
exclusiveStates: string[] = []Optional
restoreStates: string[] = []Optional
dependentStates: string[] = []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.
Sets up the main "cancel current measurement" event handler and disables camera change notifications.
The main application instance.
The active measurement instance.
Removes or deactivates this state. May be overridden by subclasses.
Always returns true.
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.
MeasurementState – Abstract base class for UI states that manage interactive measurement tools (such as height, line, or area) in a Cesium application.
Extends State, adding:
Param: name
Unique name of the state/tool ("line", "height", "dimension", etc.).
Param: button
DOM element to use for toggling/terminating the measurement state.
Param: exclusiveStates
State names that should be deactivated when this activates.
Param: restoreStates
States to restore after this state ends.
Param: dependentStates
Other state dependencies.
Method
initialize(app, measurement) - Sets up the cancel/exit handler for the button and disables camera movement interruption.
Method
terminate() - Tears down event listeners, disables global measurement flags, and resets camera change after delay.
Example