Warning

Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only. These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use. Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability. Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing. The software is provided as is with no guarantees or support.

ViewerPolylineAPI

Interface ViewerPolylineAPI

The ViewerPolylineAPI provides basic functionalities to create and visualize Polylines.

Example


// Get an instance of the ContextAPI & ViewerAPI
const theContext : ContextAPI = webvis.getContext(),
      theViewer  : ViewerAPI  = theContext.getViewer();

// Create a list of 3D positions which defines the Polyline
const linePositions : number[] = [
 0, 0, 0,
 1, 0, 0,
 2, 0, 0
];

// Create a red Polyline with the given linePositions and a width of 6 pixels
const polylineId : number = theViewer.createPolyline( linePositions , {
    color: [1, 0, 0, 1],
    width: 6
});

// Change the color of the Polyline to green
theViewer.changePolyline( polylineId, {
    color: [0, 1, 0, 1]
};

// Removes the Polyline
theViewer.removePolyline(polylineId)
interface ViewerPolylineAPI {
    changePolyline(polylineId: number, properties: PolylineProperties): void;
    createPolyline(
        positions: number[],
        properties?: PolylineProperties,
    ): number;
    removePolyline(polylineId: number): void;
}

Hierarchy (View Summary)

Methods

  • Changes the properties of the Polyline with the specified Id.

    Parameters

    • polylineId: number

      The Id of the Polyline which should be removed.

    • properties: PolylineProperties

      The properties which should be changed.

    Returns void

  • Creates a new Polyline with the specified positions and properties.

    Parameters

    • positions: number[]

      List of 3D positions which defines the Polyline.

    • Optionalproperties: PolylineProperties

      The properties of the Polyline.

    Returns number

  • Removes the Polyline with the specified Id.

    Parameters

    • polylineId: number

      The Id of the Polyline which should be removed.

    Returns void