BoundingRectangle

BoundingRectangle

new

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

:Number

The height of the rectangle.
Default Value:
  • 0.0

:Number

The width of the rectangle.
Default Value:
  • 0.0

:Number

The x coordinate of the rectangle.
Default Value:
  • 0.0

:Number

The y coordinate of the rectangle.
Default Value:
  • 0.0

Methods

Duplicates this BoundingRectangle instance.

Parameters:
Name Type Argument 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.

Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
right BoundingRectangle <optional>
The right hand side BoundingRectangle.
Returns:
Boolean true if they are equal, false otherwise.

Computes a bounding rectangle that is rectangle expanded to contain point.

Parameters:
Name Type Description
point BoundingRectangle 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.

Determines if this rectangle intersects with another.

Parameters:
Name Type Description
right BoundingRectangle A rectangle to check for intersection.
Throws:
DeveloperError : right is required.
Returns:
Intersect Intersect.INTESECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.

Computes a bounding rectangle that contains both this bounding rectangle and the argument rectangle.

Parameters:
Name Type Argument Description
right BoundingRectangle The rectangle to enclose in this bounding rectangle.
result BoundingRectangle <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>

Duplicates a BoundingRectangle instance.

Parameters:
Name Type Argument 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>

Compares the provided BoundingRectangles componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
left BoundingRectangle <optional>
The first BoundingRectangle.
right BoundingRectangle <optional>
The second BoundingRectangle.
Returns:
Boolean true if left and right are equal, false otherwise.

<static>

Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.

Parameters:
Name Type Argument 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.
Throws:
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.

<static>

Computes a bounding rectangle from an extent.

Parameters:
Name Type Argument Default Description
extent Extent The valid extent used to create a bounding rectangle.
projection Object <optional>
GeographicProjection The projection used to project the extent 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>

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
positions Array 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>

Determines if two rectangles intersect.

Parameters:
Name Type Description
left BoundingRectangle A rectangle to check for intersection.
right BoundingRectangle The other rectangle to check for intersection.
Throws:
Returns:
Intersect Intersect.INTESECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.

<static>

Computes a bounding rectangle that is the union of the left and right bounding rectangles.

Parameters:
Name Type Argument 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.
Throws:
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.