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

# Map

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

Class for creating and managing a map.

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

## Constructor {#constructor-summary}

```javascript
Map(parentElement, state[, options])
```

Creates a map instance.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`parentElement`](#param-parentElement)[*](*star) | — | Type: Object\|String

Reference to an HTML element that contains the map, or the ID of this HTML element. ||
|| [`state`](#param-state)[*](*star) | — | Type: Object

Map parameters. ||
|| [`state.behaviors`](#param-state.behaviors) | ['default'] | Type: String[]

Enabled behaviors for the map. By default, the following are enabled: dragging the map and zooming the map by multitouch or double-click on touch screen devices; dragging the map with the mouse, double-click zooming and right-click area selection on all other devices. You can specify any keys supported by behavior.Manager. ||
|| [`state.bounds`](#param-state.bounds) | — | Type: Number[][]

Geo coordinates of the viewport the map starts with. When initializing the map, you can set either a state.zoom-state.center pair, or this viewport. If state.bounds is set and the parameters state.zoom or state.center are also set, they will be ignored. ||
|| [`state.center`](#param-state.center) | — | Type: Number[]

Geo coordinates of the map center. They must be set in conjunction with state.zoom. ||
|| [`state.controls`](#param-state.controls) | ['default'] | Type: String[]

The map controls, added by default. You can specify any keys supported by [control.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/control.Manager.md). The list of available keys and default sets of controls are described in control.Manager.add. ||
|| [`state.margin`](#param-state.margin) | — | Type: Number\|Number[]

Offsets from the map edges. Passed to map.margin.Manager.setDefaultMargin. ||
|| [`state.type`](#param-state.type) | 'yandex#map' | Type: String\|[MapType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md)

Map type. Can be a key or an instance of the [MapType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md) class. List of available keys:
- 'yandex#map' - "Roadmap" map type.
- 'yandex#satellite' - "Satellite" map type.
- 'yandex#hybrid' - "Hybrid" map type. ||
|| [`state.zoom`](#param-state.zoom) | — | Type: Number

Map zoom level. It must be set in conjunction with state.center. ||
|| [`options`](#param-options) | — | Type: Object

Map options. The map options can be used to make settings for the map itself, as well as for objects that are added to it:
- Options for [map behaviors](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.behavior.Manager.md#constructor-summary).
- Options for the [map balloon](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Balloon.md#constructor-summary) with the `balloon` prefix.
- Options for the [map hint](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Hint.md#constructor-summary) with the `hint` prefix.
- Options for [geo objects](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/GeoObject.md#constructor-summary) with the `geoObject` prefix.
- Options for [layers](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Layer.md) with the `layer` prefix.
- Options for [hotspot layers](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/hotspot.Layer.md) with the `hotspotLayer` prefix.
 Options that are interpreted directly by the map itself are listed below. ||
|| [`options.autoFitToViewport`](#param-options.autoFitToViewport) | 'ifNull' | Type: String

Automatic map container tracking. By default, the map is automatically redrawn when it is initialized from a hidden container, or if we programmatically changed its dimensions; otherwise, you must call map.container.fitToViewport. The following values are available:
- 'none' — Don't track changes to the container display when initialized from a hidden container or when its size is changed programmatically.
- 'ifNull' — As soon as the container gets a CSS "display" value other than "none", 	map.container.fitToViewport executes automatically in order to fit the map to it. After this, tracking will stop.
- 'always' — Always track changes to the display state of the map container. ||
|| [`options.avoidFractionalZoom`](#param-options.avoidFractionalZoom) | true | Type: Boolean

If true, the map does not stop on fractional values of the zoom level; if false, it does.

{% note info %}

By default, this option is true for desktop browsers and false for mobile browsers.

{% endnote %} ||
|| [`options.exitFullscreenByEsc`](#param-options.exitFullscreenByEsc) | true | Type: Boolean

Enables to exit full-screen mode using the ESC button. If true, the map exits full-screen mode when the ESC button is pressed; if false, it does not. ||
|| [`options.fullscreenZIndex`](#param-options.fullscreenZIndex) | 10000 | Type: Number

The value of the z-index property of the map container in full-screen mode. ||
|| [`options.mapAutoFocus`](#param-options.mapAutoFocus) | true | Type: Boolean

If true, clicking on the map will move the focus out of the currently active DOM element; if false, it will keep the focus on the active element. ||
|| [`options.maxAnimationZoomDifference`](#param-options.maxAnimationZoomDifference) | 5 | Type: Number

The maximum difference between the current map zoom level and the new zoom level so that zooming will look smooth. ||
|| [`options.maxZoom`](#param-options.maxZoom) | 23 | Type: Number

Maximum map zoom level. ||
|| [`options.minZoom`](#param-options.minZoom) | 0 | Type: Number

Minimum map zoom level. ||
|| [`options.nativeFullscreen`](#param-options.nativeFullscreen) | false | Type: Boolean

Use the native fullscreen "mode" if possible. Switching to the native full screen mode means that the browser asks the user if they want to go into "fullscreen mode" and if the user agrees, expands the map to full screen, and hides browser controls. The user can exit the mode by pressing the ESC key. The fullscreenZIndex and exitFullscreenByEsc options have no effect in the native "fullscreen mode". ||
|| [`options.projection`](#param-options.projection) | ymaps.projection.wgs84Mercator | Type: [IProjection](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IProjection.md)

Map projection. ||
|| [`options.restrictMapArea`](#param-options.restrictMapArea) | false | Type: Boolean\|Number[][]

Sets the map viewport so that the user cannot leave the viewport area. True — Set the area to match the current display area; false — disable this option. If you need to restrict an area with known coordinates, specify this rectangular area. ||
|| [`options.suppressMapOpenBlock`](#param-options.suppressMapOpenBlock) | false | Type: Boolean

Whether to hide the offer to open the current map in Yandex Maps with all the available map information preserved as completely as possible. True - hide; false - don't hide. The link to Yandex Maps is displayed in the lower-left corner of the map. ||
|| [`options.suppressObsoleteBrowserNotifier`](#param-options.suppressObsoleteBrowserNotifier) | false | Type: Boolean

Whether to hide the notification suggesting a browser upgrade that is shown in outdated browsers. True - hide; false - don't hide. This notification is displayed in the lower-left corner of the map. ||
|| [`options.yandexMapAutoSwitch`](#param-options.yandexMapAutoSwitch) | true | Type: Boolean

true - Enable automatically switching to the Map Editor in those places where the map is not detailed enough; false - disable. This option only works for lang=ru_RU and lang=uk_UA. ||
|| [`options.yandexMapDisablePoiInteractivity`](#param-options.yandexMapDisablePoiInteractivity) | false | Type: boolean

True - disable interactivity of POI (points of interest) in the map's base layer, false — enable. ||
|| [`options.yandexMapType`](#param-options.yandexMapType) | map | Type: String

Selects one of predefined map style modes optimized for particular use case. The following values are supported:

* `map` - basic map (by default)
* `future_map` - the base map with the new design
* `driving` - automobile navigation map
* `transit` - public transport map
* `admin` - administrative map ||
|#

\* Mandatory parameter/option.

**Examples:**

**1.**

```javascript
// Initializing a map with a known center and zoom level.
var myMap = new ymaps.Map('map', {
    center: [55.74954, 37.621587],
    zoom: 10
});
```

**2.**

```javascript
// Initializing a map with a known view area.
// We assume that jQuery is enabled on the page.
var $mapElement = $('#map');
var myMap = new ymaps.Map(
    $mapElement[0],
    ymaps.util.bounds.getCenterAndZoom(
        [[55.7, 37.6], [55.8, 37.7]],
        [$mapElement.width(), $mapElement.height()]
    )
);
```

**3.**

```javascript
// Initializing a map from geocoding results.
var myMap;
ymaps.geocode('Moscow').then(function (res) {
    myMap = new ymaps.Map('map', {
        center: res.geoObjects.get(0).geometry.getCoordinates(),
        zoom : 10
    });
});
```

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [action](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#action) | [map.action.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.action.Manager.md) | Map actions manager. ||
|| [balloon](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#balloon) | [map.Balloon](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Balloon.md) | Map balloon. ||
|| [behaviors](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#behaviors) | [map.behavior.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.behavior.Manager.md) | Map behaviors manager. Enables and disables behaviors, and also provides access to their methods and properties. ||
|| [container](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#container) | [map.Container](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Container.md) | Map container. ||
|| [controls](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#controls) | [control.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/control.Manager.md) | Map controls. ||
|| [converter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#converter) | [map.Converter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Converter.md) | Converts map pixel points from global to local and back. ||
|| [copyrights](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#copyrights) | [map.Copyrights](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Copyrights.md) | Manager for copyright information on the map. ||
|| [cursors](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#cursors) | [util.cursor.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/util.cursor.Manager.md) | Map cursors manager. ||
|| [events](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#events) | [event.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/event.Manager.md) | Map event manager. Supports subscriptions with priorities. Throws an event of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) type. ||
|| [geoObjects](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#geoObjects) | [map.GeoObjects](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.GeoObjects.md) | Manager for map geo objects. ||
|| [hint](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#hint) | [map.Hint](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Hint.md) | Map hint. ||
|| [layers](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#layers) | [map.layer.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.layer.Manager.md) | Map layers manager. ||
|| [margin](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#margin) | [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md) | Map margins manager. ||
|| [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#options) | [option.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/option.Manager.md) | Map options. ||
|| [panes](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#panes) | [map.pane.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.pane.Manager.md) | Manager for map object containers. ||
|| [zoomRange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#zoomRange) | [map.ZoomRange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.ZoomRange.md) | Object that provides access to information about available zoom levels at a point. ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [actionbegin](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-actionbegin) | The start of a new smooth map movement. 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:
- action - Action that has started. ||
|| [actionbreak](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-actionbreak) | Event that occurs when an action step was prematurely stopped (for example, because another action or another step of the action was performed). 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:
- action - An action. ||
|| [actionend](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-actionend) | The end of smooth map movement. 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:
- action - Action that has stopped. ||
|| [actiontick](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-actiontick) | The start of a new step of smooth movement (for example, the user shifting the map, or a step of animated smooth zooming). 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:
- action - The action being performed at this moment.
- tick - Description of an action step in the form of an object with the fields "globalPixelCenter", "zoom", "duration" and "timingFunction". ||
|| [actiontickcomplete](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-actiontickcomplete) | The end of performing a step of smooth movement. 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:
- action - The action being performed at this moment.
- tick - Description of an action step in the form of an object with the fields "globalPixelCenter", "zoom", "duration" and "timingFunction". ||
|| [balloonclose](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-balloonclose) | Closing the balloon. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [balloonopen](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-balloonopen) | Opening a balloon on a map. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [boundschange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-boundschange) | Event for a change to the map viewport (as the result of changing the center or zoom level). 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:
- oldCenter - The previous map center, in geo coordinates.
- newCenter - The new map center, in geo coordinates.
- oldZoom - The previous zoom level.
- newZoom - The new zoom level.
- oldGlobalPixelCenter - The previous map center, in global pixels.
- newGlobalPixelCenter - The new map center, in global pixels.
- oldBounds - Previous viewport.
- newBounds - New viewport. ||
|| [click](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-click) | Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-click). ||
|| [contextmenu](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-contextmenu) | Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-contextmenu). ||
|| [dblclick](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-dblclick) | Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-dblclick). ||
|| [destroy](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-destroy) | The map was destroyed. ||
|| [hintclose](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-hintclose) | Closing the hint. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [hintopen](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-hintopen) | Opening a hint on a map. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [marginchange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-marginchange) | Map margins changed. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [mousedown](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mousedown) | Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mousedown). ||
|| [mouseenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseenter) | Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseenter). ||
|| [mouseleave](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseleave) | Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseleave). ||
|| [mousemove](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mousemove) | Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mousemove). ||
|| [mouseup](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseup) | Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-mouseup). ||
|| [multitouchend](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchend) | End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface.

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchend). ||
|| [multitouchmove](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchmove) | Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
- clientX - X coordinate of the touch relative to the viewable area of the browser.
- clientY - Y coordinate of the touch relative to the viewable area of the browser.
- pageX - X coordinate of the touch relative to the beginning of the document.
- pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchmove). ||
|| [multitouchstart](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchstart) | Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
- clientX - X coordinate of the touch relative to the viewable area of the browser.
- clientY - Y coordinate of the touch relative to the viewable area of the browser.
- pageX - X coordinate of the touch relative to the beginning of the document.
- pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from [IDomEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-multitouchstart). ||
|| [optionschange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-optionschange) | Map options changed. ||
|| [sizechange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-sizechange) | Map size 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:
- oldSize - The previous size of the map.
- newSize - The new size of the map. ||
|| [typechange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#event-typechange) | The map type changed. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [wheel](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDomEventEmitter.md#event-wheel) | Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) class. More information is available in [domEvent.manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/domEvent.manager.md).

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

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [destroy](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#destroy)() | | Destroys the map. ||
|| [getBounds](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getBounds)(\[[options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getBounds-param-options)]) | Number[][] | Returns a two-dimensional array of geo coordinates for the lower-left and upper-right corners of the map viewport. ||
|| [getCenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getCenter)(\[[options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getCenter-param-options)]) | Number[] | Returns geographical coordinates of the current map center. ||
|| [getGlobalPixelCenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getGlobalPixelCenter)(\[[options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getGlobalPixelCenter-param-options)]) | Number[] | Returns global pixel coordinates of the current map center. ||
|| [getPanoramaManager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getPanoramaManager)() | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md).<[panorama.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/panorama.Manager.md)> | Returns [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md), which will be resolved with The panorama manager for the map. If an error occurs, the promise object is rejected. ||
|| [getType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getType)() | String\|[MapType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md) | Returns the current map type. ||
|| [getZoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#getZoom)() | Number | Returns the current map zoom. ||
|| [panTo](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#panTo)([center](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#panTo-param-center)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#panTo-param-options)]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets the map center. If an array of points is passed, the map will move from one point to the other. ||
|| [setBounds](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setBounds)([bounds](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setBounds-param-bounds)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setBounds-param-options)]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Positions the map for displaying the region that was passed. ||
|| [setCenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setCenter)([center](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setCenter-param-center)[, [zoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setCenter-param-zoom)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setCenter-param-options)]]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets the map center and zoom level. The center is set in geographical coordinates. ||
|| [setGlobalPixelCenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setGlobalPixelCenter)([globalPixelCenter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setGlobalPixelCenter-param-globalPixelCenter)[, [zoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setGlobalPixelCenter-param-zoom)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setGlobalPixelCenter-param-options)]]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets the map center and zoom level. The center is set in global pixel coordinates. ||
|| [setType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setType)([type](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setType-param-type)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setType-param-options)]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets the map type. ||
|| [setZoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setZoom)([zoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setZoom-param-zoom)[, [options](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md#setZoom-param-options)]) | [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets the map zoom level. ||
|#

## Fields details {#field_detail}

### action {#action}

```javascript
{map.action.Manager} action
```

Map actions manager.

**Example:**

```javascript
var myAction = new ymaps.map.action.Single({
    center: [0, 0],
    zoom: 4,
    duration: 1000,
    timingFunction: "ease-in"
});

myMap.action.execute(myAction);
```

### balloon {#balloon}

```javascript
{map.Balloon} balloon
```

Map balloon.

### behaviors {#behaviors}

```javascript
{map.behavior.Manager} behaviors
```

Map behaviors manager. Enables and disables behaviors, and also provides access to their methods and properties.

**Example:**

```javascript
// Enabling mouse wheel zooming.
myMap.behaviors.enable('scrollZoom');
```

### container {#container}

```javascript
{map.Container} container
```

Map container.

**Example:**

```javascript
// Adjusting the map size to the new size of the container
// (for example, if the page layout changed or the map was initialized
// in the hidden state).
map.container.fitToViewport();
```

### controls {#controls}

```javascript
{control.Manager} controls
```

Map controls.

**Example:**

```javascript
myMap.controls.add('zoomControl', {
    float: 'none',
    position: {
        right: 40,
        top: 5
    }
});
```

### converter {#converter}

```javascript
{map.Converter} converter
```

Converts map pixel points from global to local and back.

**Example:**

```javascript
// Converting the mouse coordinates to geographical coordinates.
var projection = map.options.get('projection');
$('#map').bind('click', function (e) {
    console.log(projection.fromGlobalPixels(
        map.converter.pageToGlobal([e.pageX, e.pageY]), map.getZoom()
    ));
});
```

### copyrights {#copyrights}

```javascript
{map.Copyrights} copyrights
```

Manager for copyright information on the map.

**Example:**

```javascript
// Adding author information.
map.copyrights.add('© Jimmy John');
```

### cursors {#cursors}

```javascript
{util.cursor.Manager} cursors
```

Map cursors manager.

**Example:**

```javascript
// Adding the "Help" cursor to the map.
var accessor = map.cursors.push('help');
// ...
// Removing the cursor.
accessor.remove();
```

### events {#events}

```javascript
{event.Manager} events
```

Map event manager. Supports subscriptions with priorities. Throws an event of the [MapEvent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapEvent.md) type.

**Examples:**

**1.**

```javascript
// Adding a placemark in response to a click on the map.
map.events.add('click', function (e) {
    // To get the geographical coordinates of the point of click,
    // call the get('coords') method.
    var position = e.get('coords');
    map.geoObjects.add(new ymaps.Placemark(position));
});
```

**2.**

```javascript
// Tracking the map's center and zoom during smooth movements.
map.events.add('actiontick', function () {
    var state = map.action.getCurrentState();
    console.log(state.zoom, state.globalPixelCenter);
});
```

### geoObjects {#geoObjects}

```javascript
{map.GeoObjects} geoObjects
```

Manager for map geo objects.

### hint {#hint}

```javascript
{map.Hint} hint
```

Map hint.

### layers  {#layers}

```javascript
{map.layer.Manager} layers
```

Map layers manager.

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

**Example:**

```javascript
// Adding a layer of custom tiles to the map.
map.layers.add(new ymaps.Layer('http://some.server/tiles?&amp;c'));
```

### margin {#margin}

```javascript
{map.margin.Manager} margin
```

Map margins manager.

### options {#options}

```javascript
{option.Manager} options
```

Map options.

**Example:**

```javascript
// Forbidding all objects on the map to open balloons on mouse clicks.
map.options.set('openBalloonOnClick', false);
```

### panes {#panes}

```javascript
{map.pane.Manager} panes
```

Manager for map object containers.

**Example:**

```javascript
// Adding a custom element to the map controls container.
$('<div><input type="button" value="Click!"/></div>')
    .css({ position: 'absolute', left: '5px', top: '50px'})
    .appendTo(map.panes.get('controls').getElement());
```

### zoomRange {#zoomRange}

```javascript
{map.ZoomRange} zoomRange
```

Object that provides access to information about available zoom levels at a point.

**Example:**

```javascript
// Getting the maximum available map zoom level
// at the point [20, 30].
map.zoomRange.get([20, 30]).then(function (zoomRange) {
    alert(zoomRange[1]);
});
```

## Events details {#event_detail}

### actionbegin {#actionbegin}

The start of a new smooth map movement. 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:
- action - Action that has started.

### actionbreak {#actionbreak}

Event that occurs when an action step was prematurely stopped (for example, because another action or another step of the action was performed). 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:
- action - An action.

### actionend {#actionend}

The end of smooth map movement. 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:
- action - Action that has stopped.

### actiontick {#actiontick}

The start of a new step of smooth movement (for example, the user shifting the map, or a step of animated smooth zooming). 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:
- action - The action being performed at this moment.
- tick - Description of an action step in the form of an object with the fields "globalPixelCenter", "zoom", "duration" and "timingFunction".

**Example:**

```javascript
// Tracks all map movement, even user dragging
// and smooth zooming.
map.events.add('actiontick', function (e) {
    var tick = e.get('tick');
    console.log('Now the map is moving to the point (' +
        map.options.get('projection').fromGlobalPixels(tick.globalPixelCenter, tick.zoom).join(',') +
        ') during ' + e.get('tick').duration + ' milliseconds');
});
```

### actiontickcomplete {#actiontickcomplete}

The end of performing a step of smooth movement. 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:
- action - The action being performed at this moment.
- tick - Description of an action step in the form of an object with the fields "globalPixelCenter", "zoom", "duration" and "timingFunction".

### balloonclose {#balloonclose}

Closing the balloon. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### balloonopen {#balloonopen}

Opening a balloon on a map. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### boundschange {#boundschange}

Event for a change to the map viewport (as the result of changing the center or zoom level). 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:
- oldCenter - The previous map center, in geo coordinates.
- newCenter - The new map center, in geo coordinates.
- oldZoom - The previous zoom level.
- newZoom - The new zoom level.
- oldGlobalPixelCenter - The previous map center, in global pixels.
- newGlobalPixelCenter - The new map center, in global pixels.
- oldBounds - Previous viewport.
- newBounds - New viewport.

**Example:**

```javascript
// Tracking changes to the map zoom level.
map.events.add('boundschange', function (event) {
    if (event.get('newZoom') != event.get('oldZoom')) {
        alert('Zoom level changed');
    }
});
```

### destroy {#destroy}

The map was destroyed.

### hintclose {#hintclose}

Closing the hint. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### hintopen {#hintopen}

Opening a hint on a map. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### marginchange {#marginchange}

Map margins changed. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### optionschange {#optionschange}

Map options changed.

### sizechange {#sizechange}

Map size 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:
- oldSize - The previous size of the map.
- newSize - The new size of the map.

### typechange {#typechange}

The map type changed. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

## Methods details {#method_detail}

### destroy {#destroy}

```javascript
{} destroy()
```

Destroys the map.

### getBounds {#getBounds}

```javascript
{Number[][]} getBounds([options])
```

**Returns** a two-dimensional array of geo coordinates for the lower-left and upper-right corners of the map viewport.

**Parameters:**

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

Options. ||
|| [`options.useMapMargin`](#getBounds-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#


### getCenter {#getCenter}

```javascript
{Number[]} getCenter([options])
```

**Returns** geographical coordinates of the current map center.

**Parameters:**

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

Options. ||
|| [`options.useMapMargin`](#getCenter-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#


### getGlobalPixelCenter {#getGlobalPixelCenter}

```javascript
{Number[]} getGlobalPixelCenter([options])
```

**Returns** global pixel coordinates of the current map center.

**Parameters:**

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

Options. ||
|| [`options.useMapMargin`](#getGlobalPixelCenter-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#


**Example:**

```javascript
// Shifting the map 10 pixels left.
var position = map.getGlobalPixelCenter();
map.setGlobalPixelCenter([ position[0] - 10, position[1] ]);
```

### getPanoramaManager {#getPanoramaManager}

```javascript
{vow.Promise.<panorama.Manager>} getPanoramaManager()
```

Returns [vow.Promise](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) which:

- will be **resolved** with: <[panorama.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/panorama.Manager.md)> — The panorama manager for the map;
- either **rejected** with an error.
-
### getType {#getType}

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

**Returns** the current map type.

### getZoom {#getZoom}

```javascript
{Number} getZoom()
```

**Returns** the current map zoom.

### panTo {#panTo}

```javascript
{vow.Promise} panTo(center[, options])
```

Sets the map center. If an array of points is passed, the map will move from one point to the other.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`center`](#panTo-param-center)[*](*star) | — | Type: Number[]\|Object[]

The map center or an array of points to move through sequentially. ||
|| [`options`](#panTo-param-options) | — | Type: Object

Options. ||
|| [`options.checkZoomRange`](#panTo-param-options.checkZoomRange) | false | Type: Boolean

Checks whether the current zoom can be set after moving the map center. If the value of this option is "true", the method is called asynchronously. A request is sent to the server, which returns the range of acceptable zoom values for the given center. After this, the specified center and appropriate zoom are applied. ||
|| [`options.delay`](#panTo-param-options.delay) | 1000 | Type: Number

The delay time between moves, in milliseconds. ||
|| [`options.duration`](#panTo-param-options.duration) | 500 | Type: Number

Animation duration, in milliseconds. ||
|| [`options.flying`](#panTo-param-options.flying) | true | Type: Boolean

Allows decreasing and then increasing the map zoom when moving between points. If the distance between points is less than twice the size of the map container, the map smoothly moves the center to the specified point without changing the zoom level. If the distance is more, the map applies a smaller zoom level, then moves to the destination point and applies the required zoom level (emulates flying over the map). ||
|| [`options.safe`](#panTo-param-options.safe) | true | Type: Boolean

Shifts the map safely. You can only use it if the "flying" option is false. If the distance between points is less than twice the size of the map container, the map smoothly moves the center to the specified point. If the distance exceeds that value, the map instantly moves to the selected point. Use this mode to conveniently move the map without displaying unloaded tiles. ||
|| [`options.timingFunction`](#panTo-param-options.timingFunction) | 'ease-in-out' | Type: String

Timing function. The same as the value of the CSS property transition-timing-function. Full list of values: [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag](http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag) ||
|| [`options.useMapMargin`](#panTo-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Flight from Kaliningrad to Vladivostok via Moscow.
map.setCenter([54.704815, 20.466380], 10);
map.panTo([
    [55.751574, 37.573856],
    [43.134091, 131.928478]
]).then(function () {
   alert('Landed!');
}, function (err) {
   alert('An error occurred ' + err);
}, this);
```

### setBounds {#setBounds}

```javascript
{vow.Promise} setBounds(bounds[, options])
```

Positions the map for displaying the region that was passed.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`bounds`](#setBounds-param-bounds)[*](*star) | — | Type: Number[][]

Boundaries of the viewport, specified by the coordinates of the lower-left and upper-right corners of the view area. ||
|| [`options`](#setBounds-param-options) | — | Type: Object

Options. ||
|| [`options.checkZoomRange`](#setBounds-param-options.checkZoomRange) | false | Type: Boolean

Checks whether the specified zoom level can be set. If the value of this option is "true", the method is called asynchronously. A request is sent to the server, which returns the range of acceptable zoom values for the given center. After this, the specified center and appropriate zoom are applied. ||
|| [`options.duration`](#setBounds-param-options.duration) | 0 | Type: Number

Animation duration, in milliseconds. ||
|| [`options.preciseZoom`](#setBounds-param-options.preciseZoom) | false | Type: Boolean

The ability to use fractional zoom levels. ||
|| [`options.timingFunction`](#setBounds-param-options.timingFunction) | 'linear' | Type: String

Timing function. The same as the value of the CSS property transition-timing-function. Full list of values: [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag](http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag) ||
|| [`options.useMapMargin`](#setBounds-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|| [`options.zoomMargin`](#setBounds-param-options.zoomMargin) | 0 | Type: Number\|Number[]

Offset from the borders of the visible area of the map. If a single number is set, it is applied to each side. If two numbers are set, they are the horizontal and vertical margins, respectively. If an array of four numbers is set, they are the top, right, bottom, and left margins. When the "useMapMargin" option is enabled, the "zoomMargin" value is combined with the values that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// The new map center and zoom level are calculated based on the current
// map state.
// If the current zoomRange does not match the zoomRange for the new map center,
// grey tiles may be displayed if the viewport is very small.
// To avoid this problem, use the checkZoomRange option.
map.setBounds([[60,-40], [20,60]], {
   checkZoomRange: true,
}).then(function () {
      // Action has completed successfully.
   }, function (err) {
      // Specified region could not be shown
      // ...
   }, this);
```

### setCenter {#setCenter}

```javascript
{vow.Promise} setCenter(center[, zoom[, options]])
```

Sets the map center and zoom level. The center is set in geographical coordinates.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`center`](#setCenter-param-center)[*](*star) | — | Type: Number[]

Geo coordinates of the map center. ||
|| [`zoom`](#setCenter-param-zoom) | — | Type: Number

Map zoom level. ||
|| [`options`](#setCenter-param-options) | — | Type: Object

Options. ||
|| [`options.checkZoomRange`](#setCenter-param-options.checkZoomRange) | false | Type: Boolean

Checks whether the specified zoom level can be set. If the value of this option is "true", the method is called asynchronously. A request is sent to the server, which returns the range of acceptable zoom values for the given center. After this, the specified center and appropriate zoom are applied. ||
|| [`options.duration`](#setCenter-param-options.duration) | 0 | Type: Number

Animation duration, in milliseconds. ||
|| [`options.timingFunction`](#setCenter-param-options.timingFunction) | 'linear' | Type: String

Timing function. The same as the value of the CSS property transition-timing-function. Full list of values: [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag](http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag) ||
|| [`options.useMapMargin`](#setCenter-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
myMap.setCenter([40, 50], 3, {
    checkZoomRange: true
});
```

### setGlobalPixelCenter {#setGlobalPixelCenter}

```javascript
{vow.Promise} setGlobalPixelCenter(globalPixelCenter[, zoom[, options]])
```

Sets the map center and zoom level. The center is set in global pixel coordinates.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`globalPixelCenter`](#setGlobalPixelCenter-param-globalPixelCenter)[*](*star) | — | Type: Number[]

Pixel coordinates of the new map center. ||
|| [`zoom`](#setGlobalPixelCenter-param-zoom) | — | Type: Number

Map zoom level. ||
|| [`options`](#setGlobalPixelCenter-param-options) | — | Type: Object

Options. ||
|| [`options.checkZoomRange`](#setGlobalPixelCenter-param-options.checkZoomRange) | false | Type: Boolean

Checks whether the specified zoom level can be set. If the value of this option is "true", the method is called asynchronously. A request is sent to the server, which returns the range of acceptable zoom values for the given center. After this, the specified center and appropriate zoom are applied. ||
|| [`options.duration`](#setGlobalPixelCenter-param-options.duration) | 0 | Type: Number

Animation duration, in milliseconds. ||
|| [`options.timingFunction`](#setGlobalPixelCenter-param-options.timingFunction) | 'linear' | Type: String

Timing function. The same as the value of the CSS property transition-timing-function. Full list of values: [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag](http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag) ||
|| [`options.useMapMargin`](#setGlobalPixelCenter-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Shifting the map 10 pixels left.
var position = map.getGlobalPixelCenter();
map.setGlobalPixelCenter([ position[0] - 10, position[1] ]);
```

### setType {#setType}

```javascript
{vow.Promise} setType(type[, options])
```

Sets the map type.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

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

Map type. Can be a key or an instance of the [MapType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md) class. List of available keys:
- 'yandex#map' - "Roadmap" map type.
- 'yandex#satellite' - "Satellite" map type.
- 'yandex#hybrid' - "Hybrid" map type. ||
|| [`options`](#setType-param-options) | — | Type: Object

Map options. ||
|| [`options.checkZoomRange`](#setType-param-options.checkZoomRange) | false | Type: Boolean

Checks if the specified map type can be set at the specified zoom level. When set to "true", a request is sent to the server, which returns the range of acceptable zoom values for the given map type. After this, the specified center and appropriate zoom are applied. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
map.setType('yandex#hybrid', {
   checkZoomRange: true
}).then(function () {
   // The map type has been set with the acceptable zoom level.
}, this);
```

### setZoom {#setZoom}

```javascript
{vow.Promise} setZoom(zoom[, options])
```

Sets the map zoom level.

**Returns** Promise object. If the action completed successfully, returns "resolve" without a value. If an error occurred, returns "reject" with the error description.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`zoom`](#setZoom-param-zoom)[*](*star) | — | Type: Number

Map zoom level. ||
|| [`options`](#setZoom-param-options) | — | Type: Object

Options. ||
|| [`options.checkZoomRange`](#setZoom-param-options.checkZoomRange) | false | Type: Boolean

Checks whether the specified zoom level can be set. ||
|| [`options.duration`](#setZoom-param-options.duration) | 0 | Type: Number

Animation duration, in milliseconds. ||
|| [`options.useMapMargin`](#setZoom-param-options.useMapMargin) | false | Type: Boolean

Whether to use offsets that were calculated in the margins manager [map.margin.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.margin.Manager.md). ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
myMap.setZoom(4, {duration: 1000});
```

[*star]: Mandatory parameter/option.
