A renderable polygon or hierarchy of polygons.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Object with the following properties:
|
Throws:
-
DeveloperError : Either options.positions or options.polygonHierarchy can be provided, but not both.
-
DeveloperError : When options.positions is provided, at least three positions are required.
Examples:
// Example 1
var polygon = new Cesium.Polygon({
positions : Cesium.Cartesian3.fromDegreesArray([
0.0, 0.0,
10.0, 0.0,
0.0, 10.0
])
});
// Example 2
var polygon = new Cesium.Polygon();
polygon.material.uniforms.color = {
red : 1.0,
green : 0.0,
blue : 0.0,
alpha : 1.0
};
polygon.positions = Cesium.Cartesian3.fromDegreesArray([
0.0, 0.0,
10.0, 0.0,
0.0, 10.0
]);
Demo:
Members
-
Determines if the geometry instances will be created and batched on a web worker.
-
Default Value:
true
-
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 polygon is drawn on.
-
Default Value:
Ellipsoid.WGS84
-
The distance, in radians, between each latitude and longitude in the underlying geometry. A lower granularity fits the curvature of the
Polygon#ellipsoid
better, but uses more triangles.-
Default Value:
CesiumMath.RADIANS_PER_DEGREE
-
The height, in meters, that the polygon is raised above the
Polygon#ellipsoid
.-
Default Value:
0.0
-
User-defined object returned when the polygon 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
.-
Default Value:
Material.fromType(Material.ColorType)
Example:
// 1. Change the color of the default material to yellow polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // 2. Change material to horizontal stripes polygon.material = Cesium.Material.fromType(Cesium.Material.StripeType);
See:
-
positions : Array.<Cartesian3>
-
Gets or sets positions that define the boundary of the polygon.
Example:
polygon.positions = Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 10.0, 0.0, 0.0, 10.0 ]);
-
Determines if this primitive will be shown.
-
Default Value:
true
-
The angle, in radians, relative to north that the polygon's texture is rotated. Positive angles rotate counter-clockwise.
-
Default Value:
0.0