Maps API for JavaScript Developer's Guide

H.geo.Rect

Class Summary

Extends: H.geo.AbstractGeometry

This class represents a rectangular geographic area defined by the geographic coordinates of its top-left and bottom-right corners.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

clone () : {H.geo.Rect}

This method clones the given rectangle.

getTopLeft () : {H.geo.Point}

This method retrieves the top-left corner of the given rectangular area.

getBottomRight () : {H.geo.Point}

This method retrieves the bottom-right corner of the given rectangular area.

getTop () : {H.geo.Latitude}

This method retrieves the north-most latitude of the given rectangular area.

getBottom () : {H.geo.Latitude}

This method retrieves the southern-most latitude of the given rectangular area.

getLeft () : {H.geo.Longitude}

This method retrieves the left-most longitude of the given rectangular area.

getRight () : {H.geo.Longitude}

This method retrieves the right-most longitude of the given rectangular area.

getCenter () : {H.geo.Point}

This method retrieves the center point of the given rectangular area.

getWidth () : {number}

This method retrieves the width of the given rectangular area in decimal degrees.

getHeight () : {number}

This method retrieves the height of the given rectangular area in decimal degrees.

isCDB () : {boolean}

This method retrieves a Boolean value indicating whether the given rectangular area spans the date border.

isEmpty () : {boolean}

The method checks if the area enclosed by the given bounding box is 0.

containsLatLng (lat, lng, opt_skipValidation) : {boolean}

This method checks if the latitude and longitude supplied by the caller lie within the area of the given rectangular area.

containsPoint (geoPoint, opt_skipValidation) : {boolean}

This method checks if the point supplied by the caller lies within the area of the given rectangular area.

containsRect (geoRect, opt_skipValidation) : {boolean}

This method checks if the rectangular area supplied by the caller is completely contained within the given rectangular area.

mergeLatLng (lat, lng, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangular area and the latitude and longitude supplied by the caller.

mergePoint (geoPoint, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangular area and the point supplied by the caller.

mergeRect (geoRect, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller.

mergeTopLeftBottomRight (top, left, bottom, right, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller as a set of coordinates.

intersects (geoRect, opt_skipValidation) : {boolean}

This method checks if the intersection of two bounding boxes is non-empty.

static merge (topA, leftA, bottomA, rightA, topB, leftB, bottomB, rightB, opt_out) : {H.geo.Rect}

This method merges two rectangle objects defines by their coordinates. The result of the merge is a bounding rectangle which covers all the provided rectangle bounds.

static fromPoints (topLeft, bottomRight, opt_skipValidation) : {H.geo.Rect}

This method creates a rectangular area from a top-left and bottom-right points provided by the caller.

static coverPoints (pointArray, opt_skipValidation) : {?H.geo.Rect}

This method creates the minimum rectangular area covering all of the points in the array provided by the caller.

static coverLatLngAlts (latLngAltArray, opt_skipValidation) : {(H.geo.Rect | undefined)}

This method creates the minimum rectangular area covering all of the coordinates in the array provided by the caller.

static coverRects (rectArray, opt_skipValidation) : {(H.geo.Rect | undefined)}

This method creates the smallest rectangular area covering all of the rectangular areas in the array provided by the caller.

resizeToCenter (center, opt_out) : {H.geo.Rect}

This method clones the given bounding rectangle and resizes the clone if necessary until the location supplied by the caller is at its center.

getBounds () : {?H.geo.Rect}

This method returns the bounding rectangle of the geometry.

equals (other) : {boolean}

This method checks if the given geometry is equal to the geometry supplied by the caller. Two geometries are considered equal if they represent the same geometry type and have equal coordinate values.

Class Description

This class represents a rectangular geographic area defined by the geographic coordinates of its top-left and bottom-right corners.

Constructor Details

H.geo.Rect(top, left, bottom, right)

Parameters:
 
top:
{H.geo.Latitude}
 
A value indicating the northern-most latitude
left:
{H.geo.Longitude}
 
A value indicating the left-most longitude
bottom:
{H.geo.Latitude}
 
A value indicating the southern-most latitude
right:
{H.geo.Longitude}
 
A value indicating the right-most latitude

Method Details

clone () : {H.geo.Rect}

This method clones the given rectangle.

Returns:
 
{H.geo.Rect}
An object representing a clone of the given rectangle

getTopLeft () : {H.geo.Point}

This method retrieves the top-left corner of the given rectangular area.

Returns:
 
{H.geo.Point}
An object containing the geographic coordinates of the the top-left corner of the given rectangle

getBottomRight () : {H.geo.Point}

This method retrieves the bottom-right corner of the given rectangular area.

Returns:
 
{H.geo.Point}
An object containing the geographic coordinates of the given rectangle

getTop () : {H.geo.Latitude}

This method retrieves the north-most latitude of the given rectangular area.

Returns:
 
{H.geo.Latitude}
A value representing the northern-most latitude of the rectangle

getBottom () : {H.geo.Latitude}

This method retrieves the southern-most latitude of the given rectangular area.

Returns:
 
{H.geo.Latitude}
A value representing the southern-most latitude of the area

getLeft () : {H.geo.Longitude}

This method retrieves the left-most longitude of the given rectangular area.

Returns:
 
{H.geo.Longitude}
A value representing the left-most longitude of the area

getRight () : {H.geo.Longitude}

This method retrieves the right-most longitude of the given rectangular area.

Returns:
 
{H.geo.Longitude}
A value representing the right-most longitude of the area

getCenter () : {H.geo.Point}

This method retrieves the center point of the given rectangular area.

Returns:
 
{H.geo.Point}
An object representing the center point of the area

getWidth () : {number}

This method retrieves the width of the given rectangular area in decimal degrees.

Returns:
 
{number}
A value representing the width of this area

getHeight () : {number}

This method retrieves the height of the given rectangular area in decimal degrees.

Returns:
 
{number}
A value representing the height of this area

isCDB () : {boolean}

This method retrieves a Boolean value indicating whether the given rectangular area spans the date border.

Returns:
 
{boolean}
true if the area spans the date border, otherwise code false}

isEmpty () : {boolean}

The method checks if the area enclosed by the given bounding box is 0.

Returns:
 
{boolean}
true if the dimensions of the area a 0, otherwise code false}

containsLatLng (lat, lng, opt_skipValidation) : {boolean}

This method checks if the latitude and longitude supplied by the caller lie within the area of the given rectangular area.

Parameters:
 
lat:
{H.geo.Latitude}
 
A value representing the latitude
lng:
{H.geo.Longitude}
 
A value representing the longitude
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check the validity of the arguments (true)
Returns:
 
{boolean}
true if the latitude and longitude are contained in this area, otherwise false

containsPoint (geoPoint, opt_skipValidation) : {boolean}

This method checks if the point supplied by the caller lies within the area of the given rectangular area.

Parameters:
 
geoPoint:
{H.geo.IPoint}
 
An object representing the point to check
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{boolean}
true if the point is contained in this area, otherwise false

containsRect (geoRect, opt_skipValidation) : {boolean}

This method checks if the rectangular area supplied by the caller is completely contained within the given rectangular area.

Parameters:
 
geoRect:
{H.geo.Rect}
 
An object representing the rectangular area to check
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{boolean}
true if the rectangular area is contained in the given area, otherwise false

mergeLatLng (lat, lng, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangular area and the latitude and longitude supplied by the caller.

Parameters:
 
lat:
{H.geo.Latitude}
 
A value representing the latitude to check
lng:
{H.geo.Longitude}
 
A value representing the longitude to check
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
opt_out:
{H.geo.Rect=} [optional]
 
An optional rectangle object to store the result
Returns:
 
{H.geo.Rect}
Either the rectangle object provided as the out parameter or a new rectangle object

mergePoint (geoPoint, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangular area and the point supplied by the caller.

Parameters:
 
geoPoint:
{H.geo.IPoint}
 
An object representing the point to include
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
opt_out:
{H.geo.Rect=} [optional]
 
An optional rectangle object to store the result
Returns:
 
{H.geo.Rect}
Either the rectangle received as the out parameter or a new rectangle object

mergeRect (geoRect, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller.

Parameters:
 
geoRect:
{H.geo.Rect}
 
An object representing the rectangle to include
opt_skipValidation:
{boolean=} [optional]
 
A Boolean flag indicating whether to check validity of the arguments (true)
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangle object to store the result
Returns:
 
{H.geo.Rect}
Either the rectangular area received as the out parameter or a new rectangle object

mergeTopLeftBottomRight (top, left, bottom, right, opt_skipValidation, opt_out) : {H.geo.Rect}

This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller as a set of coordinates.

Parameters:
 
top:
{H.geo.Latitude}
 
A value indicating the top latitude of the rectangle to include
left:
{H.geo.Longitude}
 
A value indicating the left longitude of the rectangle to include
bottom:
{H.geo.Latitude}
 
A value indicating the bottom latitude of the rectangle to include
right:
{H.geo.Longitude}
 
A value indicating the right longitude of the rectangle to include
opt_skipValidation:
{boolean=} [optional]
 
A Boolean flag indicating whether to check validity of the arguments (true)
opt_out:
{H.geo.Rect=} [optional]
 
An optional rectangle object to store the result
Returns:
 
{H.geo.Rect}
Either the rectangle received as the out parameter or a new rectangle object

intersects (geoRect, opt_skipValidation) : {boolean}

This method checks if the intersection of two bounding boxes is non-empty.

Parameters:
 
geoRect:
{H.geo.Rect}
 
An object representing a rectangle object to test for intersection with the given rectangle
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{boolean}
A Boolean value indicating if the two bounding boxes intersect (true) or not (false)

static merge (topA, leftA, bottomA, rightA, topB, leftB, bottomB, rightB, opt_out) : {H.geo.Rect}

This method merges two rectangle objects defines by their coordinates. The result of the merge is a bounding rectangle which covers all the provided rectangle bounds.

Parameters:
 
topA:
{H.geo.Latitude}
 
A value representing the northern-most latitude
leftA:
{H.geo.Longitude}
 
A value representing the left-most longitude of operand A
bottomA:
{H.geo.Latitude}
 
A value representing the southern-most latitude of operand A
rightA:
{H.geo.Longitude}
 
A value representing the right-most latitude of operand A
topB:
{H.geo.Latitude}
 
A value representing the northern-most latitude of operand B
leftB:
{H.geo.Longitude}
 
A value representing the left-most longitude of operand B
bottomB:
{H.geo.Latitude}
 
A value representing the southern-most latitude of operand B
rightB:
{H.geo.Longitude}
 
A value representing the right-most latitude of operand B
opt_out:
{H.geo.Rect=} [optional]
 
An optional rectangle object to store the results
Returns:
 
{H.geo.Rect}
Either the rectangle provide by opt_out or a new rectangle

static fromPoints (topLeft, bottomRight, opt_skipValidation) : {H.geo.Rect}

This method creates a rectangular area from a top-left and bottom-right points provided by the caller.

Parameters:
 
topLeft:
{H.geo.IPoint}
 
An object representing the top-left corner of the area
bottomRight:
{H.geo.IPoint}
 
An object representing the bottom-right corner of the area
opt_skipValidation:
{boolean=} [optional]
 
A Boolean flag indicating whether to check validity of the arguments (true)
Returns:
 
{H.geo.Rect}
An object representing the rectangular area defined by the top-left and bottom-right corners provided by the caller

static coverPoints (pointArray, opt_skipValidation) : {?H.geo.Rect}

This method creates the minimum rectangular area covering all of the points in the array provided by the caller.

Parameters:
 
pointArray:
{Array<H.geo.IPoint>}
 
An array of points to cover
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{?H.geo.Rect}
The minimum rectangule covering the points provided by the caller or null if no point is covered

static coverLatLngAlts (latLngAltArray, opt_skipValidation) : {(H.geo.Rect | undefined)}

This method creates the minimum rectangular area covering all of the coordinates in the array provided by the caller.

Parameters:
 
latLngAltArray:
{Array<number>}
 
An array of coordinates to cover
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{(H.geo.Rect | undefined)}
The smallest rectangle covering the supplied coordinates

static coverRects (rectArray, opt_skipValidation) : {(H.geo.Rect | undefined)}

This method creates the smallest rectangular area covering all of the rectangular areas in the array provided by the caller.

Parameters:
 
rectArray:
{Array<H.geo.Rect>}
 
An array of rectangle objects to cover
opt_skipValidation:
{boolean=} [optional]
 
A Boolean indicating whether to check validity of the arguments (true)
Returns:
 
{(H.geo.Rect | undefined)}
The smallest rectangle covering the rectangles in the array provided by the caller

resizeToCenter (center, opt_out) : {H.geo.Rect}

This method clones the given bounding rectangle and resizes the clone if necessary until the location supplied by the caller is at its center.

Parameters:
 
center:
{H.geo.IPoint}
 
A point object which is to be the center of the resized rectangular area
opt_out:
{H.geo.Rect=} [optional]
 
An optional rectangle object to store the result
Returns:
 
{H.geo.Rect}
An object representing the resulting rectangle

getBounds () : {?H.geo.Rect}

This method returns the bounding rectangle of the geometry.

Returns:
 
{?H.geo.Rect}
the bounding rectangle of the geometry or null if the bounding rectangle can't be computed (e.g. for a geometry without coordinates)

equals (other) : {boolean}

This method checks if the given geometry is equal to the geometry supplied by the caller. Two geometries are considered equal if they represent the same geometry type and have equal coordinate values.

Parameters:
 
other:
{*}
 
The geometry to check against
Returns:
 
{boolean}
true if the two geometries are equal, otherwise false

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.