3D-City Model
    Preparing search index...

    LineMeasurement – Concrete measurement tool for interactively measuring 3D distances (lines) in Cesium scenes.

    Extends Measurement and uses LineDrawing for interactive drawing of a 2-point line. Automatically computes and displays the distance as a label, and updates the label as points move. Supports configuration for unit, color, and rendering state. Handles destruction and UI visibility.

    The Cesium Viewer or host application reference.

    Initial points of the measurement line.

    Color for point markers.

    Color for the line.

    Measurement unit.

    If true, will draw geometry on instantiation.

    (Optional) Parent measurement/group id.

    const meas = new LineMeasurement(viewer, {
    pointColor: Cesium.Color.RED,
    lineColor: Cesium.Color.ORANGE,
    unit: 'ft',
    render: true
    });

    console.log("Distance (m):", meas.distance);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _cartesians: any
    _finished: undefined | boolean
    _unit: undefined | string
    app: any

    Reference to the parent Cesium Viewer or app.

    cartesians: any
    destroyed: undefined | boolean
    drawing: undefined | LineDrawing
    id: string

    Unique identifier for this measurement instance.

    label: Label

    Label associated with this measurement (unit and prefix are forwarded).

    onFinishCallback: Function

    Finish callback (settable by onFinish()).

    render: any

    Accessors

    Methods

    • Finalizes and locks the measurement, displaying the final value/label. Ensures minimum two points. (Does not destroy, only finishes.)

      Returns boolean

      True if finished/locked, false if not enough points.