Documentation
Reference
2.1.55 (current version)
collection
interactivityModel
Interfaces

map.ZoomRange

Extends IEventEmitter.

Map zoom level manager. Each map already has its own zoom level manager, available as map.zoomRange. Don't instantiate new instances of this class unless necessary.

See Map.zoomRange

Constructor | Fields | Events | Methods

Constructor

map.ZoomRange(map, constraints)

Parameters:

ParameterDefault valueDescription
map *
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Map

Map.

constraints *
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number[]

An array containing the minimum and maximum map zooms.

* Mandatory parameter/option.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

Events

NameDescription
change

Changes occurred in the map zoom range.

Methods

NameReturnsDescription
get([coords])

vow.Promise

Checks the available range of zoom levels at the specified point.

getCurrent()

Number[]

Returns the current (last received) values of the minimum and maximum map zoom levels.

Events details

change

Changes occurred in the map zoom range.

Methods details

get

Checks the available range of zoom levels at the specified point.

Returns a Promise object, which will be resolved and will get an array of two numbers as a parameter - the maximum and minimum zoom at the given point.

Parameters:

ParameterDefault valueDescription
coords

Type: Number[]

Coordinates of a point. If omitted, the current map center is used.

Example:

// Finding the coordinates of the Yandex office and showing it on the map
// at the maximum possible zoom level.
ymaps.geocode('Moscow, Lev Tolstoy street, 16').then(function (res) {
    var coords = res.geoObjects.get(0).geometry.getCoordinates();
    map.zoomRange.get(coords).then(function (range) {
        map.setCenter(coords, range[1]);
    });
});

getCurrent

{Number[]} getCurrent()

Returns the current (last received) values of the minimum and maximum map zoom levels.