3D-City Model
    Preparing search index...

    PolylineMeasurement – Interactive tool for measuring the total length of a user-defined polyline in Cesium 3D scenes.

    Extends Measurement and leverages PolylineDrawing for interactive placement and editing. Provides:

    • User editing of 2 or more (up to optional max) points defining a polyline
    • Live visualization and segment labeling (via child LineMeasurements)
    • Automatic summing of all segment distances and a dynamic label for total length
    • Show/hide and cleanup controls for full lifecycle management
    • Supports custom point/line color, units, max points, visibility toggle, etc.

    Cesium Viewer or application context.

    Initial points of the polyline.

    (Optional) Maximum number of vertices allowed.

    Color of polyline points.

    Color of the polyline.

    Measurement unit for segment and total distances.

    Should geometry be drawn immediately.

    const polylineMeas = new PolylineMeasurement(viewer, {
    pointColor: Cesium.Color.BLUE,
    lineColor: Cesium.Color.RED,
    maxPoints: 10,
    render: true
    });

    // Get total measured length
    console.log('Total polyline length:', polylineMeas.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.

    destroyed: undefined | boolean
    drawing: undefined | PolylineDrawing
    id: string

    Unique identifier for this measurement instance.

    label: Label

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

    lineColor: Color

    Polyline color.

    onFinishCallback: Function

    Finish callback (settable by onFinish()).

    pointColor: Color

    Point marker color.

    render: any
    segments: undefined | any[]

    Accessors

    Methods