new RectanglePrimitive(options)
A renderable rectangle.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Object with the following properties:
|
Example:
var rectanglePrimitive = new Cesium.RectanglePrimitive({
rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
});
primitives.add(rectanglePrimitive);
Members
-
asynchronous :Boolean
-
Determines if the geometry instances will be created and batched on a web worker.
-
Default Value:
true
-
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.
-
Default Value:
false
-
ellipsoid :Ellipsoid
-
The ellipsoid that the rectangle is drawn on.
-
Default Value:
Ellipsoid.WGS84
-
granularity :Number
-
The distance, in radians, between each latitude and longitude in the underlying geometry. A lower granularity fits the curvature of the
RectanglePrimitive#ellipsoid
better, but uses more triangles.-
Default Value:
CesiumMath.RADIANS_PER_DEGREE
-
height :Number
-
The height, in meters, that the rectangle is raised above the
RectanglePrimitive#ellipsoid
.-
Default Value:
0.0
-
id :Object
-
User-defined object returned when the rectangle is picked.
-
Default Value:
undefined
See:
-
material :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 rectangle.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // 2. Change material to horizontal stripes rectangle.material = Cesium.Material.fromType(Material.StripeType);
See:
-
rectangle :Rectangle
-
The rectangle, which defines the rectangular region to draw.
-
Default Value:
undefined
-
rotation :Number
-
The angle, in radians, relative to north that the rectangle is rotated. Positive angles rotate counter-clockwise.
-
Default Value:
0.0
-
show :Boolean
-
Determines if this primitive will be shown.
-
Default Value:
true
-
textureRotationAngle :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
-
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 thanisDestroyed
will result in aDeveloperError
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.
- Rectangle#isDestroyed
Example:
rectangle = rectangle && rectangle.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 thanisDestroyed
will result in aDeveloperError
exception.Returns:
true
if this object was destroyed; otherwise,false
.- Rectangle#destroy
See:
-
update()
-
Called when
Viewer
orCesiumWidget
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:
Throws:
-
DeveloperError : this.ellipsoid must be defined.
-
DeveloperError : this.material must be defined.
-
DeveloperError : this.granularity must be defined.
-