3D-City Model
    Preparing search index...

    LineDrawing – Concrete drawing class for creating and interacting with a 3D line (2 points) in a Cesium scene.

    Extends Drawing for the specialized use case of drawing simple lines:

    • Allows placement/movement of precisely 2 points in 3D space
    • Visualizes the connection as a polylined Cesium entity with optional custom color
    • Manages visibility, cleanup, and interaction lifecycles

    The Cesium or host application instance/context.

    Array of initial Cartesian points.

    Color applied to points.

    Color for the line.

    If true, entry begins with first point added.

    Callback on point movement.

    const line = new LineDrawing(viewer, {
    pointColor: Cesium.Color.RED,
    lineColor: Cesium.Color.DEEPPINK
    });

    // After user move/set/finish
    console.log('Line points:', line.cartesians);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _lineColor: any
    _pointColor: any
    app: any
    destroyed: undefined | boolean
    id: any
    line: any

    Cesium entity for the rendered polyline.

    onFinishCallback: any
    onMoveCallback: any
    onSetCallback: any
    point: undefined | PointEntity
    pointSet: PointSet3D

    Accessors

    • get cartesians(): Cartesian3[]

      Access the current array of point positions.

      Returns Cartesian3[]

    • set cartesians(value: Cartesian3[]): void

      Parameters

      • value: Cartesian3[]

      Returns void

    Methods

    • Add another interactive 3D point to the drawing. Triggers relevant callbacks when placement is complete or limit is reached.

      Returns void

    • Render the connection polyline in the scene, if not already created. Sets up live-updating Cesium entity with per-position updates.

      Returns void