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

# control.ZoomControl

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

The "Zoom" control. The key of the control in the storage. [control.storage](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/control.storage.md) — "zoomControl".

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

## Constructor {#constructor-summary}

```javascript
control.ZoomControl([parameters])
```

**Parameters:**

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

Control parameters. ||
|| [`parameters.data`](#param-parameters.data) | — | Type: Object

Control data. ||
|| [`parameters.options`](#param-parameters.options) | — | Type: Object

Control options. ||
|| [`parameters.options.adjustMapMargin`](#param-parameters.options.adjustMapMargin) | false | Type: Boolean

Whether the control registers its size in the map margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|| [`parameters.options.layout`](#param-parameters.options.layout) | — | Type: [IZoomControlLayout](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IZoomControlLayout.md)\|String

Constructor of the control layout or the layout key in the [layout.storage](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layout.storage.md). The layout constructor is passed an object containing the fields: 
- control - Reference to the control.
- options - Control options manager control.ZoomControl.options.
- data - Control data manager control.ZoomControl.data.
- state - Control state manager control.ZoomControl.state. ||
|| [`parameters.options.position`](#param-parameters.options.position) | — | Type: Object

Object describing the position of a control. ||
|| [`parameters.options.position.bottom`](#param-parameters.options.position.bottom) | 'auto' | Type: Number\|String

Position relative to the bottom edge of the map. ||
|| [`parameters.options.position.left`](#param-parameters.options.position.left) | 10 | Type: Number\|String

Position relative to the left edge of the map. ||
|| [`parameters.options.position.right`](#param-parameters.options.position.right) | 'auto' | Type: Number\|String

Position relative to the right edge of the map. ||
|| [`parameters.options.position.top`](#param-parameters.options.position.top) | 108 | Type: Number\|String

Position relative to the top edge of the map. ||
|| [`parameters.options.size`](#param-parameters.options.size) | 'auto' | Type: String

Defines the appearance of the control. Takes the following values: 
- 'small' — Always show a small zoom control.
- 'large' — Always show a large zoom control.
- 'auto' — Automatically select the size of the control depending on the height of the map container. ||
|| [`parameters.options.visible`](#param-parameters.options.visible) | true | Type: Boolean

Indicates if the control is displayed. ||
|| [`parameters.options.zoomDuration`](#param-parameters.options.zoomDuration) | 200 | Type: Number

The length of animation playback when changing the zoom level. ||
|| [`parameters.options.zoomStep`](#param-parameters.options.zoomStep) | 1 | Type: Number

Step of the zoom level change. ||
|| [`parameters.state`](#param-parameters.state) | — | Type: Object

Object describing the state of a control. ||
|#


**Examples:**

**1.**

```javascript
// Example 1.
// Creating a small zoom control and adding it to the map.
var zoomControl = new ymaps.control.ZoomControl({
    options: {
        size: "small"
    }
});
myMap.controls.add(zoomControl);
```

**2.**

```javascript
// Example 2.
// If the control was already added to the map using a key from control.storage.
myMap.controls.add('zoomControl', {
    size: "large"
});
```

## 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/IControl.md#options) | [IOptionManager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md)| Options manager.

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

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [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). ||
|| [parentchange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md#event-parentchange)| The parent object reference changed.

Data fields:

- oldParent - Old parent.
- newParent - New parent.

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

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [getMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/control.ZoomControl.md#getMap)() | [Map](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md)
| Returns reference to the map. ||
|| [getParent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IControl.md#getParent)() | [IControlParent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IControlParent.md)\|null
| Returns link to the parent object, or null if the parent element was not set.

Inherited from [IControl](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IControl.md#getParent). ||
|| [setParent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IControl.md#setParent)([parent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IControl.md#setParent-param-parent)) | [IChildOnMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md)
| Sets the parent object. If the null value is passed, the manager element will only be deleted from the current parent object.

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

## Methods details {#method_detail}

### getMap {#getMap}

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

**Returns** reference to the map.
