Maps API for JavaScript Developer's Guide

H.math.Rect

Class Summary

Class defines a rectangle in 2-dimensional geometric space. It is used to represent the area in projected space.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

set (left, top, right, bottom)

To set all values of the rectangle's edges

getTopLeft () : {H.math.Point}

To get the rectangle's top-left vertex

getBottomRight () : {H.math.Point}

To get the rectangle's bottom-right vertex

containsXY (x, y) : {boolean}

Method checks if provided coordinates lie within rectangle.

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

To create a rectangle from a top-left and bottom-right point pair.

clone () : {H.math.Rect}

To clone a rectangle

Class Description

Class defines a rectangle in 2-dimensional geometric space. It is used to represent the area in projected space.

Constructor Details

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

Parameters:
 
left:
{number}
 
The rectangle's left edge x value
top:
{number}
 
The rectangle's top edge y value
right:
{number}
 
The rectangle's right edge x value
bottom:
{number}
 
The rectangle's bottom edge y value

Method Details

set (left, top, right, bottom)

To set all values of the rectangle's edges

Parameters:
 
left:
{number}
 
The rectangle's left edge x value
top:
{number}
 
The rectangle's top edge y value
right:
{number}
 
The rectangle's right edge x value
bottom:
{number}
 
The rectangle's bottom edge y value

getTopLeft () : {H.math.Point}

To get the rectangle's top-left vertex

Returns:
 
{H.math.Point}

getBottomRight () : {H.math.Point}

To get the rectangle's bottom-right vertex

Returns:
 
{H.math.Point}

containsXY (x, y) : {boolean}

Method checks if provided coordinates lie within rectangle.

Parameters:
 
x:
{number}
 
x-coordinate to check
y:
{number}
 
y-coordinate to check
Returns:
 
{boolean}
returns true if coordinates lie within rectangle, if parameters are isNaN returns false

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

To create a rectangle from a top-left and bottom-right point pair.

Parameters:
 
topLeft:
{H.math.IPoint}
 
the top-left vertex of the rectanle
bottomRight:
{H.math.IPoint}
 
the bottom-right vertex of the rectanle
Returns:
 
{H.math.Rect}
returns the rectangular area defined by the top-left and bottom-right vertices

clone () : {H.math.Rect}

To clone a rectangle

Returns:
 
{H.math.Rect}

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.