English中文

BoundingRectangle

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

由角、宽度和高度给出的边界矩形。 A bounding rectangle given by a corner, width and height.
名称 Name 类型 Type 默认值 Default 说明 Description
x number 0.0 可选 optional 矩形的 x 坐标。 The x coordinate of the rectangle.
y number 0.0 可选 optional 矩形的 y 坐标。 The y coordinate of the rectangle.
width number 0.0 可选 optional 矩形的宽度。 The width of the rectangle.
height number 0.0 可选 optional 矩形的高度。 The height of the rectangle.
另见: See:

成员 Members

static Cesium.BoundingRectangle.packedLength : number

用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.
矩形的高度。 The height of the rectangle.
默认值: Default Value: 0.0
矩形的宽度。 The width of the rectangle.
默认值: Default Value: 0.0
矩形的 x 坐标。 The x coordinate of the rectangle.
默认值: Default Value: 0.0
矩形的 y 坐标。 The y coordinate of the rectangle.
默认值: Default Value: 0.0

方法 Methods

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

复制 BoundingRectangle 实例。 Duplicates a BoundingRectangle instance.
名称 Name 类型 Type 说明 Description
rectangle BoundingRectangle 要复制的边界矩形。 The bounding rectangle to duplicate.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 (如果矩形未定义,则返回未定义) The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)

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

逐个比较提供的 BoundingRectangles 并返回 Compares the provided BoundingRectangles componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
left BoundingRectangle 可选 optional 第一个边界矩形。 The first BoundingRectangle.
right BoundingRectangle 可选 optional 第二个边界矩形。 The second BoundingRectangle.
返回: Returns:
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.
名称 Name 类型 Type 说明 Description
rectangle BoundingRectangle 要展开的矩形。 A rectangle to expand.
point Cartesian2 包围在边界矩形中的点。 A point to enclose in a bounding rectangle.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 The modified result parameter or a new BoundingRectangle instance if one was not provided.

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

计算包围 2D 点列表的边界矩形。矩形的角位于左下角。 Computes a bounding rectangle enclosing the list of 2D points. The rectangle is oriented with the corner at the bottom left.
名称 Name 类型 Type 说明 Description
positions Array.<Cartesian2> 边界矩形将包围的点的列表。每个点必须有 List of points that the bounding rectangle will enclose. Each point must have x and y properties.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 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.
名称 Name 类型 Type 默认值 Default 说明 Description
rectangle Rectangle 用于创建边界矩形的有效矩形。 The valid rectangle used to create a bounding rectangle.
projection object GeographicProjection 可选 optional 用于将矩形投影为 2D 的投影。 The projection used to project the rectangle into 2D.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 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.
名称 Name 类型 Type 说明 Description
left BoundingRectangle 用于检查相交的矩形。 A rectangle to check for intersection.
right BoundingRectangle 检查相交的另一个矩形。 The other rectangle to check for intersection.
返回: Returns:
Intersect.INTERSECTING 如果矩形相交, if the rectangles intersect, Intersect.OUTSIDE otherwise.

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

将提供的实例存储到提供的数组中。 Stores the provided instance into the provided array.
名称 Name 类型 Type 默认值 Default 说明 Description
value BoundingRectangle 包装的价值。 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.BoundingRectangle.union(left, right, result)BoundingRectangle

计算作为左边界矩形和右边界矩形的并集的边界矩形。 Computes a bounding rectangle that is the union of the left and right bounding rectangles.
名称 Name 类型 Type 说明 Description
left BoundingRectangle 包围在边界矩形中的矩形。 A rectangle to enclose in bounding rectangle.
right BoundingRectangle 包围在边界矩形中的矩形。 A rectangle to enclose in a bounding rectangle.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 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.
名称 Name 类型 Type 默认值 Default 说明 Description
array Array.<number> 打包的数组。 The packed array.
startingIndex number 0 可选 optional 要解包的元素的起始索引。 The starting index of the element to be unpacked.
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object into which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 The modified result parameter or a new BoundingRectangle instance if one was not provided.
复制此 BoundingRectangle 实例。 Duplicates this BoundingRectangle instance.
名称 Name 类型 Type 说明 Description
result BoundingRectangle 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 BoundingRectangle 实例(如果未提供)。 The modified result parameter or a new BoundingRectangle instance if one was not provided.
将此 BoundingRectangle 与提供的 BoundingRectangle 组件进行比较并返回 Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
right BoundingRectangle 可选 optional 右侧的BoundingRectangle。 The right hand side BoundingRectangle.
返回: Returns:
true 如果它们相等, if they are equal, false otherwise.
确定此矩形是否与另一个矩形相交。 Determines if this rectangle intersects with another.
名称 Name 类型 Type 说明 Description
right BoundingRectangle 用于检查相交的矩形。 A rectangle to check for intersection.
返回: Returns:
Intersect.INTERSECTING 如果矩形相交, if the rectangles intersect, Intersect.OUTSIDE otherwise.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.