A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both
Primitive and GroundPrimitive.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
下列属性的对象 :
|
Throws:
- RectangleGeometry#createGeometry
Example:
// 1. create a rectangle
const rectangle = new Cesium.RectangleGeometry({
ellipsoid : Cesium.Ellipsoid.default,
rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
height : 10000.0
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
// 2. create an extruded rectangle without a top
const rectangle = new Cesium.RectangleGeometry({
ellipsoid : Cesium.Ellipsoid.default,
rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
height : 10000.0,
extrudedHeight: 300000
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
Demo:
See:
Members
Methods
static Cesium.RectangleGeometry.computeRectangle(options, result) → Rectangle
根据提供的选项计算边框矩形
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
下列属性的对象 :
|
||||||||||||||||||||
result |
Rectangle | optional 存储结果的对象 . |
Returns:
结果矩形
static Cesium.RectangleGeometry.createGeometry(rectangleGeometry) → Geometry|undefined
计算一个矩形的几何表示,包括它的顶点,指数,和边框.
| Name | Type | Description |
|---|---|---|
rectangleGeometry |
RectangleGeometry | 长方形的描述. |
Returns:
计算出的顶点和指数.
Throws:
-
DeveloperError : Rotated rectangle is invalid.
将所提供的实例存储到所提供的数组中.
| Name | Type | Default | Description |
|---|---|---|---|
value |
RectangleGeometry | 包装的价值. | |
array |
Array.<number> | 装入的阵列. | |
startingIndex |
number |
0
|
optional The index into the array at which to start packing the elements. |
Returns:
装入的阵列
static Cesium.RectangleGeometry.unpack(array, startingIndex, result) → RectangleGeometry
从组合的数组中获取实例 .
| Name | Type | Default | Description |
|---|---|---|---|
array |
Array.<number> | 装填的阵列. | |
startingIndex |
number |
0
|
optional The starting index of the element to be unpacked. |
result |
RectangleGeometry | optional 存储结果的对象. |
Returns:
未提供修改的结果参数或新的矩形图形实例 .