指定为经度和纬度坐标的二维区域。
Name | Type | Default | Description |
---|---|---|---|
west |
number |
0.0
|
optional 最西端的经度,以弧度为单位,在 [-Pi, Pi] 范围内。 |
south |
number |
0.0
|
optional 最南端的纬度,以弧度为单位,在 [-Pi/2, Pi/2] 范围内。 |
east |
number |
0.0
|
optional 最东的经度,以弧度为单位,在 [-Pi, Pi] 范围内。 |
north |
number |
0.0
|
optional 最北端的纬度,以弧度为单位,在 [-Pi/2, Pi/2] 范围内。 |
See:
Members
static constant Cesium.Rectangle.MAX_VALUE : Rectangle
尽可能大的矩形。
用于将对象打包到数组中的元素数量。
[-Pi, Pi] 范围内最东的弧度经度。
-
Default Value:
0.0
获取矩形的高度(以弧度为单位)。
[-Pi/2, Pi/2] 范围内最北的弧度纬度。
-
Default Value:
0.0
[-Pi/2, Pi/2] 范围内最南端的弧度。
-
Default Value:
0.0
[-Pi, Pi] 范围内最西端的弧度经度。
-
Default Value:
0.0
获取矩形的宽度(以弧度为单位)。
Methods
static Cesium.Rectangle.center(rectangle, result) → Cartographic
计算矩形的中心。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要为其找到中心的矩形 |
result |
Cartographic | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者新的制图实例(如果未提供)。
static Cesium.Rectangle.clone(rectangle, result) → Rectangle
复制Rectangle.
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要克隆的矩形。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数 或者一个新的 Rectangle 实例(如果未提供)。(如果 rectangle 未定义,则返回 undefined)
以弧度为单位计算矩形的高度。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要计算其高度的矩形。 |
Returns:
高度。
以弧度为单位计算矩形的宽度。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要计算其宽度的矩形。 |
Returns:
宽度。
如果制图位于矩形上或矩形内,则返回 true,否则返回 false。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 矩形 |
cartographic |
Cartographic | 要包含在矩形中的制图。 |
Returns:
true(如果提供的制图位于矩形内),否则为 false。
比较提供的矩形,如果它们相等,则返回
true
,
否则 false
。
Name | Type | Description |
---|---|---|
left |
Rectangle | optional 第一个Rectangle. |
right |
Rectangle | optional 第二个 Rectangle. |
Returns:
true
如果 left 和 right 相等;否则 false
.
按组件比较提供的 Rectangles 并返回
true
如果它们通过了绝对或相对耐受性测试,
否则 false
。
Name | Type | Default | Description |
---|---|---|---|
left |
Rectangle | optional 第一个Rectangle. | |
right |
Rectangle | optional 第二个 Rectangle. | |
absoluteEpsilon |
number |
0
|
optional 用于相等性检验的绝对公差。 |
Returns:
true
如果左和右在提供的epsilon内,否则 false
。
static Cesium.Rectangle.expand(rectangle, cartographic, result) → Rectangle
通过放大提供的矩形来计算矩形,直到它包含提供的制图。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要扩展的矩形。 |
cartographic |
Cartographic | 要包含在矩形中的制图。 |
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者一个新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.fromBoundingSphere(boundingSphere, ellipsoid, result) → Rectangle
从边界球体创建一个矩形,忽略高度。
Name | Type | Default | Description |
---|---|---|---|
boundingSphere |
BoundingSphere | 边界球体。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
optional 椭球体。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数 或者一个新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.fromCartesianArray(cartesians, ellipsoid, result) → Rectangle
创建尽可能小的 Rectangle ,将所提供的数组中的所有位置括起来。
Name | Type | Default | Description |
---|---|---|---|
cartesians |
Array.<Cartesian3> | 数组实例。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
optional 笛卡尔坐标所在的椭球体。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.fromCartographicArray(cartographics, result) → Rectangle
创建尽可能小的 Rectangle ,将所提供的数组中的所有位置括起来。
Name | Type | Description |
---|---|---|
cartographics |
Array.<Cartographic> | 制图实例列表。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数或者一个新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.fromDegrees(west, south, east, north, result) → Rectangle
在给定边界经度和纬度(以度为单位)的情况下创建一个矩形。
Name | Type | Default | Description |
---|---|---|---|
west |
number |
0.0
|
optional 最西端的经度,单位为度数,范围在 [-180.0, 180.0] 范围内。 |
south |
number |
0.0
|
optional 最南端的纬度,以度为单位,范围在 [-90.0, 90.0] 范围内。 |
east |
number |
0.0
|
optional 最东的经度,在 [-180.0, 180.0] 范围内。 |
north |
number |
0.0
|
optional 在 [-90.0, 90.0] 范围内最北端的纬度,以度为单位。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数或者一个新的 Rectangle 实例(如果未提供)。
Example:
const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
static Cesium.Rectangle.fromRadians(west, south, east, north, result) → Rectangle
在给定边界经度和纬度(以弧度为单位)的情况下创建一个矩形。
Name | Type | Default | Description |
---|---|---|---|
west |
number |
0.0
|
optional [-Math.PI, Math.PI] 范围内最西端的弧度经度。 |
south |
number |
0.0
|
optional 在 [-Math.PI/2, Math.PI/2] 范围内最南端的弧度。 |
east |
number |
0.0
|
optional [-Math.PI, Math.PI] 范围内最东的弧度经度。 |
north |
number |
0.0
|
optional 在 [-Math.PI/2, Math.PI/2] 范围内最北的弧度。 |
result |
Rectangle | optional 存储结果的对象,如果应该创建新实例,则为 undefined。 |
Returns:
修改后的结果参数或者一个新的 Rectangle 实例(如果未提供)。
Example:
const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
static Cesium.Rectangle.intersection(rectangle, otherRectangle, result) → Rectangle|undefined
计算两个矩形的交集。 此函数假定矩形的坐标为
纬度和经度(以弧度为单位)并产生正确的交集,同时考虑到
相同的角度可以用多个值表示,并且
反子午线。 对于忽略这些因子且可与投影
坐标,请参阅
Rectangle.simpleIntersection
。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 在 rectangle 上查找交点 |
otherRectangle |
Rectangle | 另一个矩形,用于查找交集 |
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数, 新的 Rectangle 实例(如果未提供)或 undefined(如果没有交集)。
static Cesium.Rectangle.northeast(rectangle, result) → Cartographic
计算矩形的东北角。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要为其找到角的矩形 |
result |
Cartographic | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者新的制图实例(如果未提供)。
static Cesium.Rectangle.northwest(rectangle, result) → Cartographic
计算矩形的西北角。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要为其找到角的矩形 |
result |
Cartographic | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者新的制图实例(如果未提供)。
将提供的实例存储到提供的数组中。
Name | Type | Default | Description |
---|---|---|---|
value |
Rectangle | 要打包的值。 | |
array |
Array.<number> | 要装入的数组。 | |
startingIndex |
number |
0
|
optional 开始打包元素的数组的索引。 |
Returns:
被装入的数组
static Cesium.Rectangle.simpleIntersection(rectangle, otherRectangle, result) → Rectangle|undefined
计算两个矩形的简单交集。 与
Rectangle.intersection
不同,此函数
不会尝试将角度坐标置于一致的范围内,也不会考虑与
反子午线。 因此,它可以用于坐标不仅仅是纬度的矩形
和经度(即投影坐标)。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 在 rectangle 上查找交点 |
otherRectangle |
Rectangle | 另一个矩形,用于查找交集 |
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数,如果未提供,则为新的 Rectangle 实例,如果没有交集,则为 undefined。
static Cesium.Rectangle.southeast(rectangle, result) → Cartographic
计算矩形的东南角。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要为其找到角的矩形 |
result |
Cartographic | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者新的制图实例(如果未提供)。
static Cesium.Rectangle.southwest(rectangle, result) → Cartographic
计算矩形的西南角。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要为其找到角的矩形 |
result |
Cartographic | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或者新的制图实例(如果未提供)。
static Cesium.Rectangle.subsample(rectangle, ellipsoid, surfaceHeight, result) → Array.<Cartesian3>
对矩形进行采样,使其包含适合传递给的笛卡尔点列表
BoundingSphere#fromPoints
的 BoundingSphere#fromPoints} 中。 需要进行抽样
表示覆盖极点或穿过赤道的矩形。
Name | Type | Default | Description |
---|---|---|---|
rectangle |
Rectangle | 要进行子采样的矩形。 | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
optional 要使用的椭球体。 |
surfaceHeight |
number |
0.0
|
optional 椭球体上方的高度矩形。 |
result |
Array.<Cartesian3> | optional 存储结果的笛卡尔数组。 |
Returns:
修改后的结果参数 or a new Array of Cartesians instances if none was provided.
static Cesium.Rectangle.subsection(rectangle, westLerp, southLerp, eastLerp, northLerp, result) → Rectangle
根据 [0.0, 1.0] 范围内的标准化坐标计算矩形的子截面。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 到小节的矩形。 |
westLerp |
number | 范围 [0.0, 1.0] 内的西插值因子。必须小于或等于 eastLerp。 |
southLerp |
number | 范围 [0.0, 1.0] 内的南插因子。必须小于或等于 northLerp。 |
eastLerp |
number | 范围 [0.0, 1.0] 内的东插因子。必须大于或等于 westLerp。 |
northLerp |
number | 范围 [0.0, 1.0] 内的北插因子。必须大于或等于 southLerp。 |
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.union(rectangle, otherRectangle, result) → Rectangle
计算一个矩形,该矩形是两个矩形的并集。
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | 要包含在 rectangle 中的矩形。 |
otherRectangle |
Rectangle | 要包含在矩形中的矩形。 |
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的 Rectangle 实例(如果未提供)。
static Cesium.Rectangle.unpack(array, startingIndex, result) → Rectangle
从打包数组中检索实例。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<number> | 打包数组。 | |
startingIndex |
number |
0
|
optional 要解压缩的元素的起始索引。 |
result |
Rectangle | optional 要在其中存储结果的对象。 |
Returns:
修改后的结果参数或者一个新的 Rectangle 实例(如果未提供)。
clone(result) → Rectangle
复制Rectangle.
Name | Type | Description |
---|---|---|
result |
Rectangle | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或者一个新的 Rectangle 实例(如果未提供)。
将提供的 Rectangle 与此 Rectangle 组件进行比较,并返回
true
,否则为 false
。
Name | Type | Description |
---|---|---|
other |
Rectangle | optional 要比较的矩形。 |
Returns:
true
如果 Rectangles 相等, 否则 false
。
将提供的 Rectangle 与此 Rectangle 组件进行比较,并返回
true
,如果它们位于提供的 epsilon 内,
否则 false
。
Name | Type | Default | Description |
---|---|---|---|
other |
Rectangle | optional 要比较的矩形。 | |
epsilon |
number |
0
|
optional 用来检验等式。 |
Returns:
true
如果 Rectangle 位于提供的 epsilon 内,否则 false
。