Maps API for JavaScript Developer's Guide

# H.math.Rect

## Class Summary

This class defines a rectangle in two-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)`

This method sets the values of the edges of the rectangle.

` getTopLeft () : {H.math.Point}`

This method retrieves the top-left vertex of the rectangle.

` getBottomRight () : {H.math.Point}`

This method retrieves the bottom-right vertex of the rectangle.

` containsXY (x, y) : {boolean}`

This method checks if the provided coordinates lie within the rectangle.

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

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

` clone () : {H.math.Rect}`

This method clones the given rectangle.

## Class Description

This class defines a rectangle in two-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}`

An x-value indicating the left edge of the rectangle
`top`:
`{number}`

A y-value indicating the top edge of the rectangle
`right`:
`{number}`

An x-value indicating the right edge of the rectangle
`bottom`:
`{number}`

A y-value indicating the bottom edge of the rectangle

## Method Details

` set (left, top, right, bottom)`

This method sets the values of the edges of the rectangle.

Parameters:

`left`:
`{number}`

An x-value indicating the left edge of the rectangle
`top`:
`{number}`

A y-value indicating the top edge of the rectangle
`right`:
`{number}`

An x-value indicating the right edge of the rectangle
`bottom`:
`{number}`

A y-value indicating the bottom edge of the rectangle

` getTopLeft () : {H.math.Point}`

This method retrieves the top-left vertex of the rectangle.

Returns:

`{H.math.Point}`
An object containing the screen coordinates of the top-left vertex of the rectangle

` getBottomRight () : {H.math.Point}`

This method retrieves the bottom-right vertex of the rectangle.

Returns:

`{H.math.Point}`
An object containing the screen coordinates of the bottom-right vertex of the rectangle

` containsXY (x, y) : {boolean}`

This method checks if the provided coordinates lie within the rectangle.

Parameters:

`x`:
`{number}`

The value of the x-coordinate to check
`y`:
`{number}`

The value of the y-coordinate to check
Returns:

`{boolean}`
`true` if the coordinates lie within the rectangle, `false` if the parameters are isNaN

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

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

Parameters:

`topLeft`:
`{H.math.IPoint}`

The top-left vertex of the rectangle
`bottomRight`:
`{H.math.IPoint}`

The bottom-right vertex of the rectangle
Returns:

`{H.math.Rect}`
The rectangular area defined by its top-left and bottom-right vertices

` clone () : {H.math.Rect}`

This method clones the given rectangle.

Returns:

`{H.math.Rect}`
An object representing the newly clone rectangle

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,