new BoundingRectangle
A bounding rectangle given by a corner, width and height.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
x |
Number |
<optional> |
0.0 | The x coordinate of the rectangle. |
y |
Number |
<optional> |
0.0 | The y coordinate of the rectangle. |
width |
Number |
<optional> |
0.0 | The width of the rectangle. |
height |
Number |
<optional> |
0.0 | The height of the rectangle. |
See:
Source:
Members
-
height :Number
-
The height of the rectangle.
- Default Value:
- 0.0
-
width :Number
-
The width of the rectangle.
- Default Value:
- 0.0
-
x :Number
-
The x coordinate of the rectangle.
- Default Value:
- 0.0
-
y :Number
-
The y coordinate of the rectangle.
- Default Value:
- 0.0
Methods
-
clone
-
Duplicates this BoundingRectangle instance.
Parameters:
Name Type Argument Description resultBoundingRectangle <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. -
equals
-
Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description rightBoundingRectangle <optional>
The right hand side BoundingRectangle. Returns:
Booleantrueif they are equal,falseotherwise. -
expand
-
Computes a bounding rectangle that is rectangle expanded to contain point.
Parameters:
Name Type Description pointBoundingRectangle A point to enclose in a bounding rectangle. Throws:
DeveloperError : point is required.Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided. -
intersect
-
Determines if this rectangle intersects with another.
Parameters:
Name Type Description rightBoundingRectangle A rectangle to check for intersection. Throws:
DeveloperError : right is required.Returns:
-
union
-
Computes a bounding rectangle that contains both this bounding rectangle and the argument rectangle.
Parameters:
Name Type Argument Description rightBoundingRectangle The rectangle to enclose in this bounding rectangle. resultBoundingRectangle <optional>
The object onto which to store the result. Throws:
DeveloperError : right is required.Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided. -
<static> clone
-
Duplicates a BoundingRectangle instance.
Parameters:
Name Type Argument Description rectangleBoundingRectangle The bounding rectangle to duplicate. resultBoundingRectangle <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> equals
-
Compares the provided BoundingRectangles componentwise and returns
trueif they are equal,falseotherwise.Parameters:
Name Type Argument Description leftBoundingRectangle <optional>
The first BoundingRectangle. rightBoundingRectangle <optional>
The second BoundingRectangle. Returns:
Booleantrueif left and right are equal,falseotherwise. -
<static> expand
-
Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
Parameters:
Name Type Argument Description rectangleBoundingRectangle A rectangle to expand. pointCartesian2 A point to enclose in a bounding rectangle. resultBoundingRectangle <optional>
The object onto which to store the result. Throws:
-
DeveloperError : rectangle is required.
-
DeveloperError : point is required.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided. -
-
<static> fromExtent
-
Computes a bounding rectangle from an extent.
Parameters:
Name Type Argument Default Description extentExtent The valid extent used to create a bounding rectangle. projectionObject <optional>
GeographicProjection The projection used to project the extent into 2D. resultBoundingRectangle <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> fromPoints
-
Computes a bounding rectangle enclosing the list of 2D points. The rectangle is oriented with the corner at the bottom left.
Parameters:
Name Type Argument Description positionsArray List of points that the bounding rectangle will enclose. Each point must have xandyproperties.resultBoundingRectangle <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> intersect
-
Determines if two rectangles intersect.
Parameters:
Name Type Description leftBoundingRectangle A rectangle to check for intersection. rightBoundingRectangle The other rectangle to check for intersection. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
-
-
<static> union
-
Computes a bounding rectangle that is the union of the left and right bounding rectangles.
Parameters:
Name Type Argument Description leftBoundingRectangle A rectangle to enclose in bounding rectangle. rightBoundingRectangle A rectangle to enclose in a bounding rectangle. resultBoundingRectangle <optional>
The object onto which to store the result. Throws:
-
DeveloperError : left is required.
-
DeveloperError : right is required.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided. -
