geometry.base.Rectangle

Extends IBaseRectangleGeometry.

The "Rectangle" base geometry.

Constructor | Fields | Events | Methods

Constructor

geometry.base.Rectangle([coordinates])

Parameters:

Parameter

Default value

Description

coordinates

null

Type: Number[][]|null

An array containing coordinates of two opposite corners of the rectangle.

Example:

var rectangle = new ymaps.geometry.base.Rectangle([
    [30, 50], [31, 51]
]);

Fields

Name

Type

Description

events

event.Manager

Geometry event manager.

Events

Name

Description

change

Change to corner coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:

  • oldCoordinates - Old coordinates of the corners.
  • newCoordinates - New coordinates of the corners.

Inherited from IRectangleGeometryAccess.

Methods

Name

Returns

Description

contains(position)

Boolean

Checks whether the passed point is located inside the rectangle.

Inherited from IRectangleGeometryAccess.

freeze()

IFreezable

Switches the object to "frozen" mode.

Inherited from IFreezable.

getBounds()

Number[][]|null

Returns coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the corner with the smallest coordinate values relative to the rest of the points in the area; the second item is the corner with the largest coordinate values.

Inherited from IBaseGeometry.

getClosest(anchorPosition)

Object

Searches for the point nearest to "anchorPosition" on the rectangle contour.

Inherited from IRectangleGeometryAccess.

getCoordinates()

Number[][]

Returns coordinates of two opposite corners of the rectangle.

Inherited from IRectangleGeometryAccess.

getType()

String

Returns the "Rectangle" string.

Inherited from IBaseRectangleGeometry.

isFrozen()

Boolean

Returns true if the object is in "frozen" mode, otherwise false.

Inherited from IFreezable.

setCoordinates(coordinates)

IRectangleGeometryAccess

Sets the coordinates of two opposite corners of the rectangle.

Inherited from IRectangleGeometryAccess.

unfreeze()

IFreezable

Switches the object to active mode.

Inherited from IFreezable.

Fields details

events

{event.Manager} events

Geometry event manager.