Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolylineCollection

Hierarchy

  • PolylineCollection
    • PolylineCollection

Index

Constructors

constructor

  • new PolylineCollection(options?: { debugShowBoundingVolume?: boolean; modelMatrix?: Matrix4; useDepthTest?: boolean }): PolylineCollection
  • Parameters

    • Optional options: { debugShowBoundingVolume?: boolean; modelMatrix?: Matrix4; useDepthTest?: boolean }
      • Optional debugShowBoundingVolume?: boolean
      • Optional modelMatrix?: Matrix4
      • Optional useDepthTest?: boolean

    Returns PolylineCollection

Properties

debugShowBoundingVolume

debugShowBoundingVolume: boolean

This property is for debugging only; it is not for production use nor is it optimized.

Draws the bounding sphere for each draw command in the primitive.

length

length: number

Returns the number of polylines in this collection. This is commonly used with {@link PolylineCollection#get} to iterate over all the polylines in the collection.

modelMatrix

modelMatrix: Matrix4

The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates. When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by {@link Transforms.eastNorthUpToFixedFrame}.

Methods

add

  • add(options?: any): Polyline
  • Creates and adds a polyline with the specified initial properties to the collection. The added polyline is returned so it can be modified or removed from the collection later.

    example

    // Example 1: Add a polyline, specifying all the default values. var p = polylines.add({ show : true, positions : ellipsoid.cartographicArrayToCartesianArray([ Cesium.Cartographic.fromDegrees(-75.10, 39.57), Cesium.Cartographic.fromDegrees(-77.02, 38.53)]), width : 1 });

    Parameters

    • Optional options: any

    Returns Polyline

    The polyline that was added to the collection.

contains

  • contains(polyline: Polyline): boolean
  • Determines if this collection contains the specified polyline.

    Parameters

    • polyline: Polyline

      The polyline to check for.

    Returns boolean

    true if this collection contains the polyline, false otherwise.

destroy

  • destroy(): void
  • Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

    Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.

    example

    polylines = polylines && polylines.destroy();

    Returns void

get

  • get(index: number): Polyline
  • Returns the polyline in the collection at the specified index. Indices are zero-based and increase as polylines are added. Removing a polyline shifts all polylines after it to the left, changing their indices. This function is commonly used with {@link PolylineCollection#length} to iterate over all the polylines in the collection.

    example

    // Toggle the show property of every polyline in the collection var len = polylines.length; for (var i = 0; i < len; ++i) { var p = polylines.get(i); p.show = !p.show; }

    Parameters

    • index: number

      The zero-based index of the polyline.

    Returns Polyline

    The polyline at the specified index.

isDestroyed

  • isDestroyed(): boolean
  • Returns true if this object was destroyed; otherwise, false.

    If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.

    Returns boolean

    true if this object was destroyed; otherwise, false.

remove

  • remove(polyline: Polyline): boolean
  • Removes a polyline from the collection.

    example

    var p = polylines.add(...); polylines.remove(p); // Returns true

    Parameters

    • polyline: Polyline

      The polyline to remove.

    Returns boolean

    true if the polyline was removed; false if the polyline was not found in the collection.

removeAll

  • removeAll(): void
  • Removes all polylines from the collection.

    example

    polylines.add(...); polylines.add(...); polylines.removeAll();

    Returns void

update

  • update(): void
  • Called when Viewer or {@link CesiumWidget} render the scene to get the draw commands needed to render this primitive.

    Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:

    Returns void