A bounding rectangle given by a corner, width and height.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
x |
number |
0.0
|
可选 The x coordinate of the rectangle. |
y |
number |
0.0
|
可选 The y coordinate of the rectangle. |
width |
number |
0.0
|
可选 The width of the rectangle. |
height |
number |
0.0
|
可选 The height of the rectangle. |
成员(属性)
The number of elements used to pack the object into an array.
The height of the rectangle.
-
默认值:
0.0
The width of the rectangle.
-
默认值:
0.0
The x coordinate of the rectangle.
-
默认值:
0.0
The y coordinate of the rectangle.
-
默认值:
0.0
方法
static Cesium.BoundingRectangle.clone(rectangle, result) → BoundingRectangle
Duplicates a BoundingRectangle instance.
参数名称 | 类型 | 描述信息 |
---|---|---|
rectangle |
BoundingRectangle | The bounding rectangle to duplicate. |
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
Compares the provided BoundingRectangles componentwise and returns
true
if they are equal, false
otherwise.
参数名称 | 类型 | 描述信息 |
---|---|---|
left |
BoundingRectangle | 可选 The first BoundingRectangle. |
right |
BoundingRectangle | 可选 The second BoundingRectangle. |
返回值:
true
if left and right are equal, false
otherwise.
static Cesium.BoundingRectangle.expand(rectangle, point, result) → BoundingRectangle
Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
参数名称 | 类型 | 描述信息 |
---|---|---|
rectangle |
BoundingRectangle | A rectangle to expand. |
point |
Cartesian2 | A point to enclose in a bounding rectangle. |
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
static Cesium.BoundingRectangle.fromPoints(positions, result) → BoundingRectangle
Computes a bounding rectangle enclosing the list of 2D points.
The rectangle is oriented with the corner at the bottom left.
参数名称 | 类型 | 描述信息 |
---|---|---|
positions |
Array.<Cartesian2> |
List of points that the bounding rectangle will enclose. Each point must have x and y properties. |
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
static Cesium.BoundingRectangle.fromRectangle(rectangle, projection, result) → BoundingRectangle
Computes a bounding rectangle from a rectangle.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
rectangle |
Rectangle | The valid rectangle used to create a bounding rectangle. | |
projection |
object |
GeographicProjection
|
可选 The projection used to project the rectangle into 2D. |
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
static Cesium.BoundingRectangle.intersect(left, right) → Intersect
Determines if two rectangles intersect.
参数名称 | 类型 | 描述信息 |
---|---|---|
left |
BoundingRectangle | A rectangle to check for intersection. |
right |
BoundingRectangle | The other rectangle to check for intersection. |
返回值:
Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.
Stores the provided instance into the provided array.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
value |
BoundingRectangle | The value to pack. | |
array |
Array.<number> | The array to pack into. | |
startingIndex |
number |
0
|
可选 The index into the array at which to start packing the elements. |
返回值:
The array that was packed into
static Cesium.BoundingRectangle.union(left, right, result) → BoundingRectangle
Computes a bounding rectangle that is the union of the left and right bounding rectangles.
参数名称 | 类型 | 描述信息 |
---|---|---|
left |
BoundingRectangle | A rectangle to enclose in bounding rectangle. |
right |
BoundingRectangle | A rectangle to enclose in a bounding rectangle. |
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
static Cesium.BoundingRectangle.unpack(array, startingIndex, result) → BoundingRectangle
Retrieves an instance from a packed array.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
array |
Array.<number> | The packed array. | |
startingIndex |
number |
0
|
可选 The starting index of the element to be unpacked. |
result |
BoundingRectangle | 可选 The object into which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
clone(result) → BoundingRectangle
Duplicates this BoundingRectangle instance.
参数名称 | 类型 | 描述信息 |
---|---|---|
result |
BoundingRectangle | 可选 The object onto which to store the result. |
返回值:
The modified result parameter or a new BoundingRectangle instance if one was not provided.
Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
true
if they are equal, false
otherwise.
参数名称 | 类型 | 描述信息 |
---|---|---|
right |
BoundingRectangle | 可选 The right hand side BoundingRectangle. |
返回值:
true
if they are equal, false
otherwise.
intersect(right) → Intersect
Determines if this rectangle intersects with another.
参数名称 | 类型 | 描述信息 |
---|---|---|
right |
BoundingRectangle | A rectangle to check for intersection. |
返回值:
Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.