Vector

SWVL new Cesium.Vector(options)

A primitive for visualizing 3D vectors.
Name Type Description
options Object optional An object with the following properties:
Name Type Default Description
show Boolean true optional Determines if the vector will be shown.
position Cartesian3 Cartesian3.ZERO optional The position of the origin of the vector in WGS84 coordinates.
direction Cartesian3 Cartesian3.UNIT_Y optional The direction of the vector in WGS84 coordinates. This is assumed to be normalized.
length Number 1.0 optional The length of the vector in meters.
minimumLengthInPixels Number 0.0 optional The minimum length of the vector in pixels.
color Color Color.WHITE optional The color of the vector. The alpha value is ignored; the vector is always opaque.
id Object optional A user-defined object to return when the vector is picked with Scene#pick.
allowPicking Boolean true optional When true, the vector is pickable with Scene#pick.
debugShowBoundingVolume Boolean false optional For debugging only. Draws the bounding sphere for each DrawCommand in the vector.
debugWireframe Boolean false optional For debugging only. Draws the vector in wireframe.

Members

readonly allowPicking : Boolean

When true, the vector is pickable with Scene#pick. When false, GPU memory is saved.
Default Value: true
The color of the vector. The alpha value is ignored; the vector is always opaque.
Default Value: Color.WHITE

debugShowBoundingVolume : Boolean

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

Draws the bounding sphere for each DrawCommand in the primitive.

Default Value: false

debugWireframe : Boolean

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

Draws the vector in wireframe.

Default Value: false
The direction of the vector in WGS84 coordinates. This is assumed to be normalized.
Default Value: Cartesian3.UNIT_Y

id : Object

User-defined object returned when the vector is picked.
Default Value: undefined
See:

length : Number

The length of the vector in meters.
Default Value: 1.0

minimumLengthInPixels : Number

The minimum length of the vector in pixels. This can be used so the vector is still visible when the user is zoomed out.
Default Value: 0.0
The position of the origin of the vector in WGS84 coordinates.
Default Value: Cartesian3.ZERO

show : Boolean

Determines if the vector will be shown.
Default Value: true

Methods

destroy()undefined

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.
Returns:
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
p = p && p.destroy();
See:

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:
true if this object was destroyed; otherwise, false.
See: