---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBasePolygonGeometry.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/IBasePolygonGeometry.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# IBasePolygonGeometry

Extends [IBaseGeometry](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBaseGeometry.md), [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md).

Interface for the "Polygon" geometry.

[Constructor](#constructor-summary) | [Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
IBasePolygonGeometry()
```

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager.

Inherited from [IEventEmitter](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [change](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#event-change) | Changed coordinates. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- oldCoordinates - Old coordinates
- newCoordinates - New coordinates.
- oldFillRule - Old fill rule.
- newFillRule - New fill rule.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#event-change). ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [contains](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#contains)([position](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#contains-param-position)) | Boolean | Checks whether the passed point is located inside the polygon.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#contains). ||
|| [freeze](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze)() | [IFreezable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to "frozen" mode.

Inherited from [IFreezable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze). ||
|| [get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#get)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#get-param-index)) | Number[][] | Returns coordinates of the contour with the specified index.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#get). ||
|| [getBounds](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBaseGeometry.md#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](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBaseGeometry.md#getBounds). ||
|| [getChildGeometry](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getChildGeometry)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getChildGeometry-param-index)) | [ILinearRingGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Creates and returns an [ILinearRingGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) object for the specified contour.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getChildGeometry). ||
|| [getClosest](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getClosest)([anchorPosition](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getClosest-param-anchorPosition)) | Object | Searches for the point nearest to "anchorPosition" on the polygon contour.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getClosest). ||
|| [getCoordinates](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getCoordinates)() | Number[][][] | Returns an array of geometry coordinates.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getCoordinates). ||
|| [getFillRule](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getFillRule)() | String | Returns ID of the fill rule.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getFillRule). ||
|| [getLength](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getLength)() | Integer | Returns the number of contours in the geometry.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#getLength). ||
|| [getType](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBasePolygonGeometry.md#getType)() | String | Returns the "Polygon" string. ||
|| [insert](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#insert)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#insert-param-index), [path](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#insert-param-path)) | [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md) | Adds a new contour with the specified index.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#insert). ||
|| [isFrozen](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen)() | Boolean | Returns true if the object is in "frozen" mode, otherwise false.

Inherited from [IFreezable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen). ||
|| [remove](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#remove)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#remove-param-index)) | [ILinearRingGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Removes the contour with the specified index.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#remove). ||
|| [set](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#set)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#set-param-index), [path](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#set-param-path)) | [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md) | Sets coordinates of the contour with the specified index.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#set). ||
|| [setCoordinates](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setCoordinates)([coordinates](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setCoordinates-param-coordinates)) | [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md) | Sets an array of geometry coordinates.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setCoordinates). ||
|| [setFillRule](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setFillRule)([fillRule](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setFillRule-param-fillRule)) | [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md) | Sets the polygon's fill rule.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#setFillRule). ||
|| [splice](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#splice)([index](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#splice-param-index), [number](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#splice-param-number)) | [ILinearRingGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md)[] | Deletes a defined number of contours, starting from the specified index. New contours can be added in place of the deleted ones. Coordinates of the new contours can be passed as additional arguments after the "number" parameter.

Inherited from [IPolygonGeometryAccess](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPolygonGeometryAccess.md#splice). ||
|| [unfreeze](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze)() | [IFreezable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to active mode.

Inherited from [IFreezable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze).||
|#

## Methods details {#method_detail}

### getType {#getType}

```javascript
{String} getType()
```

**Returns** the "Polygon" string.