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

# geometry.json.polygon

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

An object that defines the JSON representation of the "Polygon" geometry.

[Constructor](#constructor-summary) | [Fields](#properties-summary)

## Constructor {#constructor-summary}

```javascript
geometry.json.polygon()
```

**Example:**

```javascript
var geometryJson = {
    type: "Polygon",
    coordinates: [
        [[0, 0], [7, 11]],
        [[1, 2], [3, 5]]
    ]
};
```

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [coordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometry.json.polygon.md#coordinates) | Number[][][]| Coordinates of the polygon. ||
|| [fillRule](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometry.json.polygon.md#fillRule) | String| ID of the polygon fill rule. Accepts one of two values: 
- evenOdd - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity 	in any direction, and counting the number of contour segments in this shape that are crossed by this ray. If the number is odd, the point is inside it; if even, the point is outside it.
- nonZero - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity 	in any direction, and checking the points at which a segment of the shape crosses this ray. Starting 	from zero, one is added each time a segment crosses the ray from left to right, and one is subtracted each time a segment 	crosses the ray from right to left. If the result equals zero, the point 	is inside the contour. Otherwise, it is outside it. ||
|| [type](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryJson.md#type) | String| ID of the geometry type.

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

## Fields details {#field_detail}

### coordinates {#coordinates}

```javascript
{Number[][][]} coordinates
```

Coordinates of the polygon.

### fillRule {#fillRule}

```javascript
{String} fillRule
```

ID of the polygon fill rule. Accepts one of two values: 
- evenOdd - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity 	in any direction, and counting the number of contour segments in this shape that are crossed by this ray. If the number is odd, the point is inside it; if even, the point is outside it.
- nonZero - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity 	in any direction, and checking the points at which a segment of the shape crosses this ray. Starting 	from zero, one is added each time a segment crosses the ray from left to right, and one is subtracted each time a segment 	crosses the ray from right to left. If the result equals zero, the point 	is inside the contour. Otherwise, it is outside it.
