ExtentPrimitive

ExtentPrimitive

new

A renderable rectangular extent.

Parameters:
Name Type Argument Default Description
options.ellipsoid Ellipsoid <optional>
Ellipsoid.WGS84 The ellipsoid that the extent is drawn on.
options.extent Extent <optional>
undefined The extent, which defines the rectangular region to draw.
options.granularity Number <optional>
CesiumMath.RADIANS_PER_DEGREE The distance, in radians, between each latitude and longitude in the underlying geometry.
options.height Number <optional>
0.0 The height, in meters, that the extent is raised above the ExtentPrimitive#ellipsoid.
options.rotation Number <optional>
0.0 The angle, in radians, relative to north that the extent is rotated. Positive angles rotate counter-clockwise.
options.textureRotationAngle Number <optional>
0.0 The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
options.show Boolean <optional>
true Determines if this primitive will be shown.
options.material Material <optional>
undefined The surface appearance of the primitive.
Example
var extentPrimitive = new ExtentPrimitive({
  extent : Extent.fromDegrees(0.0, 20.0, 10.0, 30.0)
});
primitives.add(extentPrimitive);
Source:

Members

:Ellipsoid

The ellipsoid that the extent is drawn on.
Default Value:
  • Ellipsoid.WGS84

:Extent

The extent, which defines the rectangular region to draw.
Default Value:
  • undefined

:Number

The distance, in radians, between each latitude and longitude in the underlying geometry. A lower granularity fits the curvature of the ExtentPrimitive#ellipsoid better, but uses more triangles.
Default Value:
  • CesiumMath.RADIANS_PER_DEGREE

:Number

The height, in meters, that the extent is raised above the ExtentPrimitive#ellipsoid.
Default Value:
  • 0.0

:Material

The surface appearance of the primitive. This can be one of several built-in Material objects or a custom material, scripted with Fabric.

The default material is Material.ColorType.

Example
// 1. Change the color of the default material to yellow
extent.material.uniforms.color = new Color(1.0, 1.0, 0.0, 1.0);

// 2. Change material to horizontal stripes
extent.material = Material.fromType(scene.getContext(), Material.StripeType);
See:

:Number

The angle, in radians, relative to north that the extent is rotated. Positive angles rotate counter-clockwise.
Default Value:
  • 0.0

:Boolean

Determines if this primitive will be shown.
Default Value:
  • true

:Number

The angle, in radians, relative to north that the primitive's texture is rotated. Positive angles rotate counter-clockwise.
Default Value:
  • 0.0

Methods

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.

Throws:
DeveloperError : This object was destroyed, i.e., destroy() was called.
Returns:
Example
extent = extent && extent.destroy();
See:
  • Extent#isDestroyed

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.
See:
  • Extent#destroy