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

# IGeometry

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

Interface of a geometry.

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

## Constructor {#constructor-summary}

```javascript
IGeometry()
```

## Fields {#properties-summary}

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

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

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

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [mapchange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#event-mapchange) | Map reference changed. Instance of the [Event](https://yandex.com.tr/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.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- oldMap - Old map.
- newMap - New map. ||
|| [optionschange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange) | Change to the object options.

Inherited from [ICustomizable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange). ||
|| [pixelgeometrychange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#event-pixelgeometrychange) | The pixel geometry changed. Instance of the [Event](https://yandex.com.tr/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.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelGeometry - New [IPixelGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPixelGeometry.md) pixel geometry. ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [getBounds](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.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 southwest corner of the area; the second item is the northeast corner. ||
|| [getMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#getMap)() | [Map](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md)\|null | Returns the current map. ||
|| [getPixelGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#getPixelGeometry)(\[[options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#getPixelGeometry-param-options)]) | [IPixelGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPixelGeometry.md) | Returns the pixel geometry corresponding to the given geometry, its options, and the map state. ||
|| [getType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBaseGeometry.md#getType)() | String | Returns ID of the geometry type.

Inherited from [IBaseGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IBaseGeometry.md#getType). ||
|| [setMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#setMap)([map](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometry.md#setMap-param-map)) | | Sets the map. ||
|#

## Events details {#event_detail}

### mapchange {#mapchange}

Map reference changed. Instance of the [Event](https://yandex.com.tr/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.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- oldMap - Old map.
- newMap - New map.

### pixelgeometrychange {#pixelgeometrychange}

The pixel geometry changed. Instance of the [Event](https://yandex.com.tr/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.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelGeometry - New [IPixelGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPixelGeometry.md) pixel geometry.

## Methods details {#method_detail}

### getBounds {#getBounds}

```javascript
{Number[][]|null} getBounds()
```

**Returns** coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the southwest corner of the area; the second item is the northeast corner.

**Example:**

```javascript
// Setting the map center and zoom so that the geometry is displayed in its entirety inside the visible area.
map.setBounds(myGeometry.getBounds());
```

# getMap {#getMap}

```javascript
{Map|null} getMap()
```

**Returns** the current map.

### getPixelGeometry {#getPixelGeometry}

```javascript
{IPixelGeometry} getPixelGeometry([options])
```

**Returns** the pixel geometry corresponding to the given geometry, its options, and the map state.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`options`](#getPixelGeometry-param-options) | — | Type: Object

Hash of options that allow to exclude part of the current geometry options for this calculation. ||
|#


**Example:**

```javascript
// Getting a pixel representation of the geometry with geodesics calculated, but without optimizing deletion of invisible points.
myGeometry.getPixelGeometry({
    geodesic: true,
    simplification: false
}).getCoordinates();
```

### setMap {#setMap}

```javascript
{} setMap(map)
```

Sets the map.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`map`](#setMap-param-map)[*](*star) | — | Type: [Map](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md)\|null

Reference to the map. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.