BoundingRectangle

new Cesium.BoundingRectangle(x, y, width, height)

由角、宽度和高度给定的边界矩形。
Name Type Default Description
x number 0.0 optional x坐标 rectangle.
y number 0.0 optional y坐标 rectangle.
width number 0.0 optional 宽度 rectangle.
height number 0.0 optional 高度 rectangle.
See:

Members

static Cesium.BoundingRectangle.packedLength : number

用于将对象打包到数组中的元素数量。
矩形的高度。
Default Value: 0.0
The width of the rectangle.
Default Value: 0.0
x坐标 rectangle.
Default Value: 0.0
y坐标 rectangle.
Default Value: 0.0

Methods

static Cesium.BoundingRectangle.clone(rectangle, result)BoundingRectangle

复制BoundingRectangle instance.
Name Type Description
rectangle BoundingRectangle 要复制的边界矩形。
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。 (Returns undefined if rectangle is undefined)

static Cesium.BoundingRectangle.equals(left, right)boolean

比较提供的BoundingRectangles组件并返回 true,否则为false
Name Type Description
left BoundingRectangle optional 第一个BoundingRectangle.
right BoundingRectangle optional 第二个 BoundingRectangle.
Returns:
true如果左和右相等,否则false

static Cesium.BoundingRectangle.expand(rectangle, point, result)BoundingRectangle

通过扩大所提供的矩形直至包含所提供的点来计算边界矩形。
Name Type Description
rectangle BoundingRectangle 要展开的矩形。
point Cartesian2 要包围在边界矩形中的点。
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。

static Cesium.BoundingRectangle.fromPoints(positions, result)BoundingRectangle

计算包含2D点列表的边界矩形。 矩形以左下角的角为方向。
Name Type Description
positions Array.<Cartesian2> 边界矩形将包围的点列表。每个点必须具有xy属性。
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。

static Cesium.BoundingRectangle.fromRectangle(rectangle, projection, result)BoundingRectangle

从一个矩形计算一个边界矩形。
Name Type Default Description
rectangle Rectangle 用于创建边界矩形的有效矩形。
projection object GeographicProjection optional 用于将矩形投影到2D中的投影。
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。

static Cesium.BoundingRectangle.intersect(left, right)Intersect

确定两个矩形是否相交。
Name Type Description
left BoundingRectangle 检查是否有交集的矩形。
right BoundingRectangle 另一个要检查相交的矩形。
Returns:
Intersect.INTERSECTING如果矩形相交,否则 Intersect.OUTSIDE

static Cesium.BoundingRectangle.pack(value, array, startingIndex)Array.<number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value BoundingRectangle 要打包的值。
array Array.<number> 要装入的数组。
startingIndex number 0 optional 开始打包元素的数组的索引。
Returns:
被装入的数组

static Cesium.BoundingRectangle.union(left, right, result)BoundingRectangle

计算一个边界矩形,它是左右边界矩形的并集。
Name Type Description
left BoundingRectangle 要包围在边界矩形中的矩形。
right BoundingRectangle 在边界矩形中包围的矩形。
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。

static Cesium.BoundingRectangle.unpack(array, startingIndex, result)BoundingRectangle

从打包数组中检索实例。
Name Type Default Description
array Array.<number> 打包数组。
startingIndex number 0 optional 要解压缩的元素的起始索引。
result BoundingRectangle optional 要在其中存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。
复制BoundingRectangle instance.
Name Type Description
result BoundingRectangle optional 要在其上存储结果的对象。
Returns:
修改后的结果参数,如果没有提供,则使用新的BoundingRectangle实例。
将此BoundingRectangle与提供的BoundingRectangle组件进行比较并返回 true,否则为false
Name Type Description
right BoundingRectangle optional 右边 BoundingRectangle.
Returns:
true,否则为false
确定此矩形是否与另一个矩形相交。
Name Type Description
right BoundingRectangle A rectangle to check for intersection.
Returns:
Intersect.INTERSECTING如果矩形相交,否则 Intersect.OUTSIDE
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.