3D-City Model
    Preparing search index...

    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:

    • automatic button event binding/cancellation,
    • measurement object lifecycle management,
    • global flag coordination. Designed for composition: sub-classes implement the measurement (e.g., LineMeasurementState).

    Unique name of the state/tool ("line", "height", "dimension", etc.).

    DOM element to use for toggling/terminating the measurement state.

    State names that should be deactivated when this activates.

    States to restore after this state ends.

    Other state dependencies.

    initialize(app, measurement) - Sets up the cancel/exit handler for the button and disables camera movement interruption.

    terminate() - Tears down event listeners, disables global measurement flags, and resets camera change after delay.

    class LineMeasurementState extends MeasurementState { ... }
    const state = new LineMeasurementState(myBtn);
    state.initialize(app, measurement);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    button: HTMLButtonElement

    The toggling/activation button for this measurement state.

    dependentStates: string[]

    Required/precondition states.

    exclusiveStates: string[]

    States that are deactivated when this state activates.

    name: string

    Name/identifier for the state.

    restoreStates: string[]

    States that should be restored when this state ends.

    Methods

    • Sets up the main "cancel current measurement" event handler and disables camera change notifications.

      Parameters

      • app: any

        The main application instance.

      • measurement: Measurement

        The active measurement instance.

      Returns void

    • Removes or deactivates this state. May be overridden by subclasses.

      Returns boolean

      Always returns true.

    • Ends the measurement state: removes button event listeners, clears global measurement flag, and resets camera-change flag after 1 second.

      Returns boolean

      Always true on proper termination.