Maps API for JavaScript Developer's Guide

H.geo.Rect

Class Summary

This class represents a rectangular geographic area. The area is defined by four geographical coordinates two (left, right) longitudes and two (top, bottom) latitudes.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

equals (other) : {boolean}

To compare this rectangle with a supplied other rectangle for equality.

clone () : {H.geo.Rect}

Toclone this rectangle.

getTopLeft () : {H.geo.Point}

This method returns the top-left corner of the rectangular area.

getBottomRight () : {H.geo.Point}

This method returns the bottom-right corner of the rectangular area.

getTop () : {H.geo.Latitude}

This method returns the north-most latitude of this rectangular area

getBottom () : {H.geo.Latitude}

This method returns the south-most latitude of this rectangular area

getLeft () : {H.geo.Longitude}

This method returns the left-most longitude of this rectangular area

getRight () : {H.geo.Longitude}

This method returns the right-most longitude of this rectangular area

getCenter () : {H.geo.Point}

This method returns the center point of this rectangular area

getWidth () : {number}

Returns this width of this rectangular area in decimal degrees.

getHeight () : {number}

Returns this height of this rectangular area in decimal degrees.

isCDB () : {boolean}

Returns a boolean value indicating whether this rectangular area spans across 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 this rectangular area.

containsPoint (geoPoint, opt_skipValidation) : {boolean}

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

containsRect (geoRect, opt_skipValidation) : {boolean}

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

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

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

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

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

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

This method returns the smallest bounding box that covers this rectangular area and the rectangular area supplied by the caller.

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

This method returns the smallest bounding box that covers this rectangular area and the rectangular area supplied by the caller.

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 rects by their values. The result of the merge is a bounding rect which covers all provided rect bounds.

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

This method creates a rectangular area from a top-left and bottom-right point pair.

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

This method creates the minimum rectangular area covering all of the points in the argument array.

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

This method creates the minimum rectangular area covering all of the coordinates in the argument array.

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

This method creates the minimum rectangular area covering all of the rectangular areas in the argument array.

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

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

Class Description

This class represents a rectangular geographic area. The area is defined by four geographical coordinates two (left, right) longitudes and two (top, bottom) latitudes.

Constructor Details

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

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

Method Details

equals (other) : {boolean}

To compare this rectangle with a supplied other rectangle for equality.

Parameters:
 
other:
{H.geo.Rect}
 
Returns:
 
{boolean}
Whether the two rectangles are equal.

clone () : {H.geo.Rect}

Toclone this rectangle.

Returns:
 
{H.geo.Rect}

getTopLeft () : {H.geo.Point}

This method returns the top-left corner of the rectangular area.

Returns:
 
{H.geo.Point}
the top-left corner of the area

getBottomRight () : {H.geo.Point}

This method returns the bottom-right corner of the rectangular area.

Returns:
 
{H.geo.Point}
the bottom-right corner of the area

getTop () : {H.geo.Latitude}

This method returns the north-most latitude of this rectangular area

Returns:
 
{H.geo.Latitude}
the north-most latitude of the area

getBottom () : {H.geo.Latitude}

This method returns the south-most latitude of this rectangular area

Returns:
 
{H.geo.Latitude}
the south-most latitude of the area

getLeft () : {H.geo.Longitude}

This method returns the left-most longitude of this rectangular area

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

getRight () : {H.geo.Longitude}

This method returns the right-most longitude of this rectangular area

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

getCenter () : {H.geo.Point}

This method returns the center point of this rectangular area

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

getWidth () : {number}

Returns this width of this rectangular area in decimal degrees.

Returns:
 
{number}
the width of this area

getHeight () : {number}

Returns this height of this rectangular area in decimal degrees.

Returns:
 
{number}
the height of this area

isCDB () : {boolean}

Returns a boolean value indicating whether this rectangular area spans across the date border.

Returns:
 
{boolean}
true if the area spans across the date border, otherwise 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 false

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

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

Parameters:
 
lat:
{H.geo.Latitude}
 
the latitude
lng:
{H.geo.Longitude}
 
the longitude
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
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 this rectangular area.

Parameters:
 
geoPoint:
{H.geo.IPoint}
 
the point
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
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 area of this rectangular area.

Parameters:
 
geoRect:
{H.geo.Rect}
 
the rectangular area
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{boolean}
true if the rectangular area is contained in this area, otherwise false

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

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

Parameters:
 
lat:
{H.geo.Latitude}
 
the latitude
lng:
{H.geo.Longitude}
 
the longitude
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangular area to store the result
Returns:
 
{H.geo.Rect}
either the rectangular area passed as out parameter or a new rectangular area

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

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

Parameters:
 
geoPoint:
{H.geo.IPoint}
 
the point to merge
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangular area to store the result
Returns:
 
{H.geo.Rect}
either the rectangular area passed as out parameter or a new rectangular area

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

This method returns the smallest bounding box that covers this rectangular area and the rectangular area supplied by the caller.

Parameters:
 
geoRect:
{H.geo.Rect}
 
the point to merge
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangular area to store the result
Returns:
 
{H.geo.Rect}
either the rectangular area passed as out parameter or a new rectangular area

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

This method returns the smallest bounding box that covers this rectangular area and the rectangular area supplied by the caller.

Parameters:
 
top:
{H.geo.Latitude}
 
The top latitude of the rectangle to merge
left:
{H.geo.Longitude}
 
The left longitude of the rectangle to merge
bottom:
{H.geo.Latitude}
 
The bottom latitude of the rectangle to merge
right:
{H.geo.Longitude}
 
The right longitude of the rectangle to merge
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangular area to store the result
Returns:
 
{H.geo.Rect}
either the rectangular area passed as out parameter or a new rectangular area

intersects (geoRect, opt_skipValidation) : {boolean}

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

Parameters:
 
geoRect:
{H.geo.Rect}
 
a rectangular area to be tested for intersection with this rectangular area
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{boolean}
a boolean value indicating whether the two areas intersect

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

This method merges two rects by their values. The result of the merge is a bounding rect which covers all provided rect bounds.

Parameters:
 
topA:
{H.geo.Latitude}
 
the northern-most latitude
leftA:
{H.geo.Longitude}
 
the left-most longitude of operand A
bottomA:
{H.geo.Latitude}
 
the southern-most latitude of operand A
rightA:
{H.geo.Longitude}
 
the right-most latitude of operand A
topB:
{H.geo.Latitude}
 
the northern-most latitude of operand B
leftB:
{H.geo.Longitude}
 
the left-most longitude of operand B
bottomB:
{H.geo.Latitude}
 
the southern-most latitude of operand B
rightB:
{H.geo.Longitude}
 
the right-most latitude of operand B
opt_out:
{H.geo.Rect=} [optional]
 
an optional rect to store the results
Returns:
 
{H.geo.Rect}
either the opt_out rect or a new rect

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

This method creates a rectangular area from a top-left and bottom-right point pair.

Parameters:
 
topLeft:
{H.geo.IPoint}
 
the top-left corner of the area
bottomRight:
{H.geo.IPoint}
 
the bottom-right corner of the area
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{H.geo.Rect}
returns the rectangular area defined by the top-left and bottom-right corners

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

This method creates the minimum rectangular area covering all of the points in the argument array.

Parameters:
 
pointArray:
{Array<H.geo.IPoint>}
 
the array of points to cover
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{?H.geo.Rect}
returns the minimum rectangular area covering the points 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 argument array.

Parameters:
 
latLngAltArray:
{Array<number>}
 
the array of coordinates to cover
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{(H.geo.Rect | undefined)}
returns the minimum rectangular area covering the coordinates

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

This method creates the minimum rectangular area covering all of the rectangular areas in the argument array.

Parameters:
 
rectArray:
{Array<H.geo.Rect>}
 
the array of points to cover
opt_skipValidation:
{boolean=} [optional]
 
a boolean flag indicating whether to check validity of the arguments
Returns:
 
{(H.geo.Rect | undefined)}
returns the minimum rectangular area covering the rectangular areas

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

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

Parameters:
 
center:
{H.geo.IPoint}
 
a point which is to be the center of the resized rectangular area
opt_out:
{H.geo.Rect=} [optional]
 
an optional rectangular area to store the result
Returns:
 
{H.geo.Rect}
the resized rectangular area

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.