指定为经度和纬度坐标的二维区域。 A two dimensional region specified as longitude and latitude coordinates.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
west |
number |
0.0
|
可选 optional 最西边的经度(以弧度表示),范围为 [-Pi, Pi]。 The westernmost longitude, in radians, in the range [-Pi, Pi]. |
south |
number |
0.0
|
可选 optional 最南端的纬度(以弧度表示),范围为 [-Pi/2, Pi/2]。 The southernmost latitude, in radians, in the range [-Pi/2, Pi/2]. |
east |
number |
0.0
|
可选 optional 最东经度(以弧度表示),范围为 [-Pi, Pi]。 The easternmost longitude, in radians, in the range [-Pi, Pi]. |
north |
number |
0.0
|
可选 optional 最北纬度(以弧度为单位),范围为 [-Pi/2, Pi/2]。 The northernmost latitude, in radians, in the range [-Pi/2, Pi/2]. |
另见: See:
成员 Members
static constant Cesium.Rectangle.MAX_VALUE : Rectangle
最大可能的矩形。 The largest possible rectangle.
用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.
[-Pi, Pi] 范围内的最东经度(以弧度表示)。 The easternmost longitude in radians in the range [-Pi, Pi].
-
默认值: Default Value:
0.0
获取矩形的高度(以弧度为单位)。 Gets the height of the rectangle in radians.
范围 [-Pi/2, Pi/2] 内的最北纬度(以弧度表示)。 The northernmost latitude in radians in the range [-Pi/2, Pi/2].
-
默认值: Default Value:
0.0
最南端纬度(以弧度表示)范围 [-Pi/2, Pi/2]。 The southernmost latitude in radians in the range [-Pi/2, Pi/2].
-
默认值: Default Value:
0.0
[-Pi, Pi] 范围内的最西经度(以弧度表示)。 The westernmost longitude in radians in the range [-Pi, Pi].
-
默认值: Default Value:
0.0
获取矩形的宽度(以弧度为单位)。 Gets the width of the rectangle in radians.
方法 Methods
static Cesium.Rectangle.center(rectangle, result) → Cartographic
计算矩形的中心。 Computes the center of a rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要查找中心的矩形 The rectangle for which to find the center |
result |
Cartographic | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的制图实例(如果未提供)。 The modified result parameter or a new Cartographic instance if none was provided.
static Cesium.Rectangle.clone(rectangle, result) → Rectangle
复制一个矩形。 Duplicates a Rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要克隆的矩形。 The rectangle to clone. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 (如果矩形未定义,则返回未定义) The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
计算矩形的弧度高度。 Computes the height of a rectangle in radians.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要计算高度的矩形。 The rectangle to compute the height of. |
返回: Returns:
高度。 The height.
计算矩形的弧度宽度。 Computes the width of a rectangle in radians.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要计算宽度的矩形。 The rectangle to compute the width of. |
返回: Returns:
宽度。 The width.
如果制图位于矩形之上或之内,则返回 true,否则返回 false。 Returns true if the cartographic is on or inside the rectangle, false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 长方形 The rectangle |
cartographic |
Cartographic | 要测试的地图。 The cartographic to test. |
返回: Returns:
如果提供的地图位于矩形内,则为 true,否则为 false。 true if the provided cartographic is inside the rectangle, false otherwise.
比较提供的矩形并返回 Compares the provided rectangles and returns
true 如果它们相等, if they are equal,
false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
left |
Rectangle | 可选 optional 第一个矩形。 The first Rectangle. |
right |
Rectangle | 可选 optional 第二个矩形。 The second Rectangle. |
返回: Returns:
true 如果左和右相等;否则 if left and right are equal; otherwise false.
按组件比较提供的矩形并返回 Compares the provided Rectangles componentwise and returns
true 如果他们通过了绝对或相对耐受性测试, if they pass an absolute or relative tolerance test,
false otherwise.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
left |
Rectangle | 可选 optional 第一个矩形。 The first Rectangle. | |
right |
Rectangle | 可选 optional 第二个矩形。 The second Rectangle. | |
absoluteEpsilon |
number |
0
|
可选 optional 用于相等性测试的绝对 epsilon 容差。 The absolute epsilon tolerance to use for equality testing. |
返回: Returns:
true 如果 left 和 right 在提供的 epsilon 范围内, if left and right are within the provided epsilon, false otherwise.
static Cesium.Rectangle.expand(rectangle, cartographic, result) → Rectangle
通过放大提供的矩形直到它包含提供的地图来计算矩形。 Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要展开的矩形。 A rectangle to expand. |
cartographic |
Cartographic | 包含在矩形中的地图。 A cartographic to enclose in a rectangle. |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if one was not provided.
static Cesium.Rectangle.fromBoundingSphere(boundingSphere, ellipsoid, result) → Rectangle
从边界球体创建一个矩形,忽略高度。 Create a rectangle from a bounding sphere, ignoring height.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
boundingSphere |
BoundingSphere | 边界球体。 The bounding sphere. | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
可选 optional 椭球体。 The ellipsoid. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
static Cesium.Rectangle.fromCartesianArray(cartesians, ellipsoid, result) → Rectangle
创建包含所提供数组中所有位置的尽可能最小的矩形。 Creates the smallest possible Rectangle that encloses all positions in the provided array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
cartesians |
Array.<Cartesian3> | 笛卡尔实例的列表。 The list of Cartesian instances. | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
可选 optional 笛卡尔坐标系所在的椭球体。 The ellipsoid the cartesians are on. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
static Cesium.Rectangle.fromCartographicArray(cartographics, result) → Rectangle
创建包含所提供数组中所有位置的尽可能最小的矩形。 Creates the smallest possible Rectangle that encloses all positions in the provided array.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
cartographics |
Array.<Cartographic> | 制图实例的列表。 The list of Cartographic instances. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
static Cesium.Rectangle.fromDegrees(west, south, east, north, result) → Rectangle
给定边界经度和纬度(以度为单位)创建一个矩形。 Creates a rectangle given the boundary longitude and latitude in degrees.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
west |
number |
0.0
|
可选 optional 最西经度(以度为单位),范围为 [-180.0, 180.0]。 The westernmost longitude in degrees in the range [-180.0, 180.0]. |
south |
number |
0.0
|
可选 optional 最南端的纬度(以度为单位)范围为 [-90.0, 90.0]。 The southernmost latitude in degrees in the range [-90.0, 90.0]. |
east |
number |
0.0
|
可选 optional 最东经度(以度为单位)范围为 [-180.0, 180.0]。 The easternmost longitude in degrees in the range [-180.0, 180.0]. |
north |
number |
0.0
|
可选 optional 最北纬度(以度为单位)范围为 [-90.0, 90.0]。 The northernmost latitude in degrees in the range [-90.0, 90.0]. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
示例: Example:
const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
static Cesium.Rectangle.fromRadians(west, south, east, north, result) → Rectangle
创建一个给定边界经度和纬度(以弧度表示)的矩形。 Creates a rectangle given the boundary longitude and latitude in radians.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
west |
number |
0.0
|
可选 optional [-Math.PI, Math.PI] 范围内的最西经度(以弧度表示)。 The westernmost longitude in radians in the range [-Math.PI, Math.PI]. |
south |
number |
0.0
|
可选 optional [-Math.PI/2, Math.PI/2] 范围内的最南纬度(以弧度表示)。 The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. |
east |
number |
0.0
|
可选 optional [-Math.PI, Math.PI] 范围内的最东经度(以弧度表示)。 The easternmost longitude in radians in the range [-Math.PI, Math.PI]. |
north |
number |
0.0
|
可选 optional [-Math.PI/2, Math.PI/2] 范围内的最北纬度(以弧度表示)。 The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. |
result |
Rectangle | 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
示例: 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
计算两个矩形的交集。该函数假设矩形的坐标是以弧度表示的纬度和经度,并生成正确的交集,同时考虑到同一角度可以用多个值表示以及经度在反子午线处的环绕这一事实。对于忽略这些因素并可与投影坐标一起使用的简单交叉点,请参阅 Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are latitude and longitude in radians and produces a correct intersection, taking into account the fact that the same angle can be represented with multiple values as well as the wrapping of longitude at the anti-meridian. For a simple intersection that ignores these factors and can be used with projected coordinates, see
Rectangle.simpleIntersection.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 在矩形上找到交点 On rectangle to find an intersection |
otherRectangle |
Rectangle | 另一个矩形寻找交点 Another rectangle to find an intersection |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数,如果未提供则为新的 Rectangle 实例,如果没有交集则为未定义。 The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
static Cesium.Rectangle.northeast(rectangle, result) → Cartographic
计算矩形的东北角。 Computes the northeast corner of a rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要查找其角点的矩形 The rectangle for which to find the corner |
result |
Cartographic | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的制图实例(如果未提供)。 The modified result parameter or a new Cartographic instance if none was provided.
static Cesium.Rectangle.northwest(rectangle, result) → Cartographic
计算矩形的西北角。 Computes the northwest corner of a rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要查找其角点的矩形 The rectangle for which to find the corner |
result |
Cartographic | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的制图实例(如果未提供)。 The modified result parameter or a new Cartographic instance if none was provided.
将提供的实例存储到提供的数组中。 Stores the provided instance into the provided array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
value |
Rectangle | 包装的价值。 The value to pack. | |
array |
Array.<number> | 要打包到的数组。 The array to pack into. | |
startingIndex |
number |
0
|
可选 optional 开始打包元素的数组索引。 The index into the array at which to start packing the elements. |
返回: Returns:
被打包成的数组 The array that was packed into
static Cesium.Rectangle.simpleIntersection(rectangle, otherRectangle, result) → Rectangle|undefined
计算两个矩形的简单交集。不像 Computes a simple intersection of two rectangles. Unlike
Rectangle.intersection,此函数不会尝试将角坐标置于一致的范围内或考虑穿越反子午线。因此,它可用于坐标不仅仅是纬度和经度(即投影坐标)的矩形。 , this function does not attempt to put the angular coordinates into a consistent range or to account for crossing the anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude and longitude (i.e. projected coordinates).
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 在矩形上找到交点 On rectangle to find an intersection |
otherRectangle |
Rectangle | 另一个矩形寻找交点 Another rectangle to find an intersection |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数,如果未提供则为新的 Rectangle 实例,如果没有交集则为未定义。 The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
static Cesium.Rectangle.southeast(rectangle, result) → Cartographic
计算矩形的东南角。 Computes the southeast corner of a rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要查找其角点的矩形 The rectangle for which to find the corner |
result |
Cartographic | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的制图实例(如果未提供)。 The modified result parameter or a new Cartographic instance if none was provided.
static Cesium.Rectangle.southwest(rectangle, result) → Cartographic
计算矩形的西南角。 Computes the southwest corner of a rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 要查找其角点的矩形 The rectangle for which to find the corner |
result |
Cartographic | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的制图实例(如果未提供)。 The modified result parameter or a new Cartographic instance if none was provided.
static Cesium.Rectangle.subsample(rectangle, ellipsoid, surfaceHeight, result) → Array.<Cartesian3>
对矩形进行采样,使其包含适合传递到的笛卡尔点列表 Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
BoundingSphere#fromPoints。需要采样来考虑覆盖两极或穿过赤道的矩形。 . Sampling is necessary to account for rectangles that cover the poles or cross the equator.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
rectangle |
Rectangle | 要进行二次采样的矩形。 The rectangle to subsample. | |
ellipsoid |
Ellipsoid |
Ellipsoid.default
|
可选 optional 要使用的椭球体。 The ellipsoid to use. |
surfaceHeight |
number |
0.0
|
可选 optional 椭圆体上方矩形的高度。 The height of the rectangle above the ellipsoid. |
result |
Array.<Cartesian3> | 可选 optional 用于存储结果的笛卡尔数组。 The array of Cartesians onto which to store the result. |
返回: Returns:
修改后的结果参数或新的笛卡尔实例数组(如果未提供)。 The modified result parameter 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] 范围内的标准化坐标计算矩形的一部分。 Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 矩形要分段。 The rectangle to subsection. |
westLerp |
number | 范围为 [0.0, 1.0] 的西插值因子。必须小于或等于 eastLerp。 The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp. |
southLerp |
number | 南方插值因子的范围为 [0.0, 1.0]。必须小于或等于northLerp。 The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp. |
eastLerp |
number | 范围 [0.0, 1.0] 内的东插值因子。必须大于或等于 westLerp。 The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp. |
northLerp |
number | 范围 [0.0, 1.0] 内的北插值因子。必须大于或等于 SouthLerp。 The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp. |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
static Cesium.Rectangle.union(rectangle, otherRectangle, result) → Rectangle
计算两个矩形的并集矩形。 Computes a rectangle that is the union of two rectangles.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
Rectangle | 一个矩形包围在矩形中。 A rectangle to enclose in rectangle. |
otherRectangle |
Rectangle | 一个矩形包围在一个矩形中。 A rectangle to enclose in a rectangle. |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
static Cesium.Rectangle.unpack(array, startingIndex, result) → Rectangle
从打包数组中检索实例。 Retrieves an instance from a packed array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
array |
Array.<number> | 打包的数组。 The packed array. | |
startingIndex |
number |
0
|
可选 optional 要解包的元素的起始索引。 The starting index of the element to be unpacked. |
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object into which to store the result. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if one was not provided.
clone(result) → Rectangle
复制此矩形。 Duplicates this Rectangle.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
result |
Rectangle | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的 Rectangle 实例(如果未提供)。 The modified result parameter or a new Rectangle instance if none was provided.
将提供的 矩形 与此 矩形 分量进行比较并返回 Compares the provided Rectangle with this Rectangle componentwise and returns
true 如果它们相等, if they are equal, false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
other |
Rectangle | 可选 optional 要比较的矩形。 The Rectangle to compare. |
返回: Returns:
true 如果矩形相等, if the Rectangles are equal, false otherwise.
将提供的 矩形 与此 矩形 分量进行比较并返回 Compares the provided Rectangle with this Rectangle componentwise and returns
true 如果它们在提供的 epsilon 范围内, if they are within the provided epsilon,
false otherwise.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
other |
Rectangle | 可选 optional 要比较的矩形。 The Rectangle to compare. | |
epsilon |
number |
0
|
可选 optional 用于相等性测试的 epsilon。 The epsilon to use for equality testing. |
返回: Returns:
true 如果矩形在提供的 epsilon 范围内, if the Rectangles are within the provided epsilon, false otherwise.
