new RiverGeometry(options)
A description of a polygon on the ellipsoid. The polygon is Cesium.defined by a polygon hierarchy. Polygon geometry can be rendered with both Primitive and GroundPrimitive.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Object with the following properties:
|
- See:
-
- RiverGeometry#createGeometry
- RiverGeometry#fromPositions
Example
// 1. create a polygon from points
var polygon = new Cesium.RiverGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
)
});
var geometry = Cesium.RiverGeometry.createGeometry(polygon);
// 2. create a nested polygon with holes
var polygonWithHole = new Cesium.RiverGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-109.0, 30.0,
-95.0, 30.0,
-95.0, 40.0,
-109.0, 40.0
]),
[new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-107.0, 31.0,
-107.0, 39.0,
-97.0, 39.0,
-97.0, 31.0
]),
[new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-105.0, 33.0,
-99.0, 33.0,
-99.0, 37.0,
-105.0, 37.0
]),
[new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-103.0, 34.0,
-101.0, 34.0,
-101.0, 36.0,
-103.0, 36.0
])
)]
)]
)]
)
});
var geometry = Cesium.RiverGeometry.createGeometry(polygonWithHole);
// 3. create extruded polygon
var extrudedPolygon = new Cesium.RiverGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
),
extrudedHeight: 300000
});
var geometry = Cesium.RiverGeometry.createGeometry(extrudedPolygon);
Members
-
_indices
-
feat:2106 河流覆盖物类型 传入自定义顶点indices 传入自定义UV坐标
-
packedLengthNumber
-
The number of elements used to pack the object into an array.
Methods
-
RiverGeometry.computeRectangle(options, result){Cesium.Rectangle}
engineExtensions/core/RiverGeometry.js, line 1064 -
Returns the bounding rectangle given the provided options
Name Type Description optionsObject Object with the following properties:
Name Type Default Description polygonHierarchyPolygonHierarchy A polygon hierarchy that can include holes.
granularityNumber Cesium.Math.RADIANS_PER_DEGREE 可选 The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
arcTypeCesium.ArcType Cesium.ArcType.GEODESIC 可选 The type of line the polygon edges must follow. Valid options are
Cesium.ArcType.GEODESICandCesium.ArcType.RHUMB.ellipsoidCesium.Ellipsoid Cesium.Ellipsoid.WGS84 可选 The ellipsoid to be used as a reference.
resultCesium.Rectangle 可选 An object in which to store the result.
Returns:
Type Description Cesium.Rectangle The result rectangle -
RiverGeometry.createGeometry(polygonGeometry){Cesium.Geometry|undefined}
engineExtensions/core/RiverGeometry.js, line 1104 -
Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
Name Type Description polygonGeometryRiverGeometry A description of the polygon.
Returns:
Type Description Cesium.Geometry | undefined The computed vertices and indices. -
RiverGeometry.fromPositions(options){RiverGeometry}
engineExtensions/core/RiverGeometry.js, line 896 -
A description of a polygon from an array of positions. Polygon geometry can be rendered with both
PrimitiveandGroundPrimitive.Name Type Description optionsObject Object with the following properties:
Name Type Default Description positionsArray.<Cesium.Cartesian3> An array of positions that Cesium.defined the corner points of the polygon.
heightNumber 0.0 可选 The height of the polygon.
extrudedHeightNumber 可选 The height of the polygon extrusion.
vertexFormatCesium.VertexFormat Cesium.VertexFormat.DEFAULT 可选 The vertex attributes to be computed.
indicesArray.<Number> 可选 自定义顶点索引
stFloat32Array 可选 自定义UV坐标
stRotationNumber 0.0 可选 The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
ellipsoidCesium.Ellipsoid Cesium.Ellipsoid.WGS84 可选 The ellipsoid to be used as a reference.
granularityNumber Cesium.Math.RADIANS_PER_DEGREE 可选 The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
perPositionHeightBoolean false 可选 Use the height of options.positions for each position instead of using options.height to determine the height.
closeTopBoolean true 可选 When false, leaves off the top of an extruded polygon open.
closeBottomBoolean true 可选 When false, leaves off the bottom of an extruded polygon open.
arcTypeCesium.ArcType Cesium.ArcType.GEODESIC 可选 The type of line the polygon edges must follow. Valid options are
Cesium.ArcType.GEODESICandCesium.ArcType.RHUMB.- See:
-
- RiverGeometry#createGeometry
Returns:
Type Description RiverGeometry Example
// create a polygon from points var polygon = Cesium.RiverGeometry.fromPositions({ positions : Cesium.Cartesian3.fromDegreesArray([ -72.0, 40.0, -70.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0 ]) }); var geometry = Cesium.RiverGeometry.createGeometry(polygon); -
RiverGeometry.pack(value, array, startingIndex){Array.<Number>}
engineExtensions/core/RiverGeometry.js, line 938 -
Stores the provided instance into the provided array.
Name Type Default Description valueRiverGeometry The value to pack.
arrayArray.<Number> The array to pack into.
startingIndexNumber 0 可选 The index into the array at which to start packing the elements.
Returns:
Type Description Array.<Number> The array that was packed into -
RiverGeometry.unpack(array, startingIndex, result)
engineExtensions/core/RiverGeometry.js, line 986 -
Retrieves an instance from a packed array.
Name Type Default Description arrayArray.<Number> The packed array.
startingIndexNumber 0 可选 The starting index of the element to be unpacked.
resultRiverGeometry 可选 The object into which to store the result.