Vector

new Cesium.Vector()

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

Members

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: