3D-City Model
    Preparing search index...

    PolylineDrawing – Interactive drawing class for creating polylines (multi-segment lines) in Cesium scenes.

    Extends Drawing to support:

    • User placement of at least two, up to an optional maximum number of points
    • Live rendering of a polyline Cesium entity connecting all points in order
    • Properties for controlling color, visibility, and dynamic point operations
    • All necessary cleanup and lifecycle management for editing workflows

    The Cesium Viewer or application context.

    Optional initial list of points.

    (Optional) maximum allowed vertices.

    Color for the interactive points.

    Color for the polyline.

    Start with the first point added.

    Fired when a point is moved.

    Fired when a point is set.

    const polyline = new PolylineDrawing(viewer, {
    maxPoints: 6,
    lineColor: Cesium.Color.YELLOW,
    pointColor: Cesium.Color.RED
    });

    // Listen for user-finished actions or updates, then:
    console.log('Polyline geometry:', polyline.cartesians);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

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

    Cesium polyline entity for this drawing.

    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 Cesium polyline entity, creating it only once. Entity positions are kept reactive through CallbackProperty.

      Returns void

    • Complete the drawing only if two or more points are placed. For open-ended drawings, will remove the unfinished point.

      Returns boolean

      true if the polyline is valid/finished, else false.