Map
Extends IDomEventEmitter.
Class for creating and managing a map.
Constructor | Fields | Events | Methods
Constructor
Map(parentElement, state[, options])
Creates a map instance.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object|String Reference to an HTML element that contains the map, or the ID of this HTML element. |
|
— |
Type: Object Map parameters. |
|
['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. |
|
— |
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. |
|
— |
Type: Number[] Geo coordinates of the map center. They must be set in conjunction with state.zoom. |
|
['default'] |
Type: String[] The map controls, added by default. You can specify any keys supported by control.Manager. The list of available keys and default sets of controls are described in control.Manager.add. |
|
— |
Type: Number|Number[] Offsets from the map edges. Passed to map.margin.Manager.setDefaultMargin. |
|
'yandex#map' |
Type: String|MapType Map type. Can be a key or an instance of the MapType class. List of available keys:
|
|
— |
Type: Number Map zoom level. It must be set in conjunction with state.center. |
|
— |
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:
|
|
'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:
|
|
true |
Type: Boolean If true, the map does not stop on fractional values of the zoom level; if false, it does. Note By default, this option is true for desktop browsers and false for mobile browsers. |
|
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. |
|
10000 |
Type: Number The value of the z-index property of the map container in full-screen mode. |
|
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. |
|
5 |
Type: Number The maximum difference between the current map zoom level and the new zoom level so that zooming will look smooth. |
|
23 |
Type: Number Maximum map zoom level. |
|
0 |
Type: Number Minimum map zoom level. |
|
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". |
|
ymaps.projection.wgs84Mercator |
Type: IProjection Map projection. |
|
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. |
|
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. |
|
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. |
|
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. |
|
false |
Type: boolean True - disable interactivity of POI (points of interest) in the map's base layer, false — enable. |
|
map |
Type: String Selects one of predefined map style modes optimized for particular use case. The following values are supported:
|
* Mandatory parameter/option.
Examples:
1.
// Initializing a map with a known center and zoom level.
var myMap = new ymaps.Map('map', {
center: [55.74954, 37.621587],
zoom: 10
});
2.
// 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.
// 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
Name |
Type |
Description |
Map actions manager. |
||
Map balloon. |
||
Map behaviors manager. Enables and disables behaviors, and also provides access to their methods and properties. |
||
Map container. |
||
Map controls. |
||
Converts map pixel points from global to local and back. |
||
Manager for copyright information on the map. |
||
Map cursors manager. |
||
Map event manager. Supports subscriptions with priorities. Throws an event of the MapEvent type. |
||
Manager for map geo objects. |
||
Map hint. |
||
Map layers manager. |
||
Map margins manager. |
||
Map options. |
||
Manager for map object containers. |
||
Object that provides access to information about available zoom levels at a point. |
Events
Name |
Description |
The start of a new smooth map movement. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
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 class. Names of fields that are available via the Event.get method:
|
|
The end of smooth map movement. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
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 class. Names of fields that are available via the Event.get method:
|
|
The end of performing a step of smooth movement. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Closing the balloon. Instance of the Event class. |
|
Opening a balloon on a map. Instance of the Event class. |
|
Event for a change to the map viewport (as the result of changing the center or zoom level). Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
The map was destroyed. |
|
Closing the hint. Instance of the Event class. |
|
Opening a hint on a map. Instance of the Event class. |
|
Map margins changed. Instance of the Event class. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
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 class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface. Inherited from IDomEventEmitter. |
|
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:
Inherited from IDomEventEmitter. |
|
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:
Inherited from IDomEventEmitter. |
|
Map options changed. |
|
Map size changed. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
The map type changed. Instance of the Event class. |
|
Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
Methods
Name |
Returns |
Description |
destroy() |
Destroys the map. |
|
Number[][] |
Returns a two-dimensional array of geo coordinates for the lower-left and upper-right corners of the map viewport. |
|
Number[] |
Returns geographical coordinates of the current map center. |
|
Number[] |
Returns global pixel coordinates of the current map center. |
|
Returns vow.Promise, which will be resolved with The panorama manager for the map. If an error occurs, the promise object is rejected. |
||
getType() |
String|MapType |
Returns the current map type. |
getZoom() |
Number |
Returns the current map zoom. |
Sets the map center. If an array of points is passed, the map will move from one point to the other. |
||
Positions the map for displaying the region that was passed. |
||
Sets the map center and zoom level. The center is set in geographical coordinates. |
||
Sets the map center and zoom level. The center is set in global pixel coordinates. |
||
Sets the map type. |
||
Sets the map zoom level. |
Fields details
action
{map.action.Manager} action
Map actions manager.
Example:
var myAction = new ymaps.map.action.Single({
center: [0, 0],
zoom: 4,
duration: 1000,
timingFunction: "ease-in"
});
myMap.action.execute(myAction);
balloon
{map.Balloon} balloon
Map balloon.
behaviors
{map.behavior.Manager} behaviors
Map behaviors manager. Enables and disables behaviors, and also provides access to their methods and properties.
Example:
// Enabling mouse wheel zooming.
myMap.behaviors.enable('scrollZoom');
container
{map.Container} container
Map container.
Example:
// 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
{control.Manager} controls
Map controls.
Example:
myMap.controls.add('zoomControl', {
float: 'none',
position: {
right: 40,
top: 5
}
});
converter
{map.Converter} converter
Converts map pixel points from global to local and back.
Example:
// 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
{map.Copyrights} copyrights
Manager for copyright information on the map.
Example:
// Adding author information.
map.copyrights.add('© Jimmy John');
cursors
{util.cursor.Manager} cursors
Map cursors manager.
Example:
// Adding the "Help" cursor to the map.
var accessor = map.cursors.push('help');
// ...
// Removing the cursor.
accessor.remove();
events
{event.Manager} events
Map event manager. Supports subscriptions with priorities. Throws an event of the MapEvent type.
Examples:
1.
// 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.
// 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
{map.GeoObjects} geoObjects
Manager for map geo objects.
hint
{map.Hint} hint
Map hint.
layers
{map.layer.Manager} layers
Map layers manager.
See Layer
Example:
// Adding a layer of custom tiles to the map.
map.layers.add(new ymaps.Layer('http://some.server/tiles?&c'));
margin
{map.margin.Manager} margin
Map margins manager.
options
{option.Manager} options
Map options.
Example:
// Forbidding all objects on the map to open balloons on mouse clicks.
map.options.set('openBalloonOnClick', false);
panes
{map.pane.Manager} panes
Manager for map object containers.
Example:
// 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
{map.ZoomRange} zoomRange
Object that provides access to information about available zoom levels at a point.
Example:
// 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
actionbegin
The start of a new smooth map movement. Instance of the Event class. Names of fields that are available via the Event.get method:
- action - Action that has started.
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 class. Names of fields that are available via the Event.get method:
- action - An action.
actionend
The end of smooth map movement. Instance of the Event class. Names of fields that are available via the Event.get method:
- action - Action that has stopped.
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 class. Names of fields that are available via the Event.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:
// 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
The end of performing a step of smooth movement. Instance of the Event class. Names of fields that are available via the Event.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
Closing the balloon. Instance of the Event class.
balloonopen
Opening a balloon on a map. Instance of the Event class.
boundschange
Event for a change to the map viewport (as the result of changing the center or zoom level). Instance of the Event class. Names of fields that are available via the Event.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:
// 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
The map was destroyed.
hintclose
Closing the hint. Instance of the Event class.
hintopen
Opening a hint on a map. Instance of the Event class.
marginchange
Map margins changed. Instance of the Event class.
optionschange
Map options changed.
sizechange
Map size changed. Instance of the Event class. Names of fields that are available via the Event.get method:
- oldSize - The previous size of the map.
- newSize - The new size of the map.
typechange
The map type changed. Instance of the Event class.
Methods details
destroy
{} destroy()
Destroys the map.
getBounds
{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 |
— |
Type: Object Options. |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
getCenter
{Number[]} getCenter([options])
Returns geographical coordinates of the current map center.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Options. |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
getGlobalPixelCenter
{Number[]} getGlobalPixelCenter([options])
Returns global pixel coordinates of the current map center.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Options. |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
Example:
// Shifting the map 10 pixels left.
var position = map.getGlobalPixelCenter();
map.setGlobalPixelCenter([ position[0] - 10, position[1] ]);
getPanoramaManager
{vow.Promise.<panorama.Manager>} getPanoramaManager()
Returns vow.Promise which:
- will be resolved with: <panorama.Manager> — The panorama manager for the map;
- either rejected with an error.
getType
{String|MapType} getType()
Returns the current map type.
getZoom
{Number} getZoom()
Returns the current map zoom.
panTo
{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 |
— |
Type: Number[]|Object[] The map center or an array of points to move through sequentially. |
|
— |
Type: Object Options. |
|
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. |
|
1000 |
Type: Number The delay time between moves, in milliseconds. |
|
500 |
Type: Number Animation duration, in milliseconds. |
|
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). |
|
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. |
|
'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 |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
* Mandatory parameter/option.
Example:
// 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
{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 |
— |
Type: Number[][] Boundaries of the viewport, specified by the coordinates of the lower-left and upper-right corners of the view area. |
|
— |
Type: Object Options. |
|
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. |
|
0 |
Type: Number Animation duration, in milliseconds. |
|
false |
Type: Boolean The ability to use fractional zoom levels. |
|
'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 |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
|
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. |
* Mandatory parameter/option.
Example:
// 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
{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 |
— |
Type: Number[] Geo coordinates of the map center. |
|
— |
Type: Number Map zoom level. |
|
— |
Type: Object Options. |
|
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. |
|
0 |
Type: Number Animation duration, in milliseconds. |
|
'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 |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
* Mandatory parameter/option.
Example:
myMap.setCenter([40, 50], 3, {
checkZoomRange: true
});
setGlobalPixelCenter
{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 |
— |
Type: Number[] Pixel coordinates of the new map center. |
|
— |
Type: Number Map zoom level. |
|
— |
Type: Object Options. |
|
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. |
|
0 |
Type: Number Animation duration, in milliseconds. |
|
'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 |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
* Mandatory parameter/option.
Example:
// Shifting the map 10 pixels left.
var position = map.getGlobalPixelCenter();
map.setGlobalPixelCenter([ position[0] - 10, position[1] ]);
setType
{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: String|MapType Map type. Can be a key or an instance of the MapType class. List of available keys:
|
— |
Type: Object Map options. |
|
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:
map.setType('yandex#hybrid', {
checkZoomRange: true
}).then(function () {
// The map type has been set with the acceptable zoom level.
}, this);
setZoom
{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 |
|
— |
Type: Number Map zoom level. |
— |
Type: Object Options. |
|
false |
Type: Boolean Checks whether the specified zoom level can be set. |
|
0 |
Type: Number Animation duration, in milliseconds. |
|
false |
Type: Boolean Whether to use offsets that were calculated in the margins manager map.margin.Manager. |
* Mandatory parameter/option.
Example:
myMap.setZoom(4, {duration: 1000});
Mandatory parameter/option.