control.ZoomControl
Extends IControl, ICustomizable.
The "Zoom" control. The key of the control in the storage. control.storage — "zoomControl".
Constructor | Fields | Events | Methods
Constructor
control.ZoomControl([parameters])
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Control parameters. |
|
— |
Type: Object Control data. |
|
— |
Type: Object Control options. |
|
false |
Type: Boolean Whether the control registers its size in the map margins manager map.margin.Manager. |
|
— |
Type: IZoomControlLayout|String Constructor of the control layout or the layout key in the layout.storage. The layout constructor is passed an object containing the fields:
|
|
— |
Type: Object Object describing the position of a control. |
|
'auto' |
Type: Number|String Position relative to the bottom edge of the map. |
|
10 |
Type: Number|String Position relative to the left edge of the map. |
|
'auto' |
Type: Number|String Position relative to the right edge of the map. |
|
108 |
Type: Number|String Position relative to the top edge of the map. |
|
'auto' |
Type: String Defines the appearance of the control. Takes the following values:
|
|
true |
Type: Boolean Indicates if the control is displayed. |
|
200 |
Type: Number The length of animation playback when changing the zoom level. |
|
1 |
Type: Number Step of the zoom level change. |
|
— |
Type: Object Object describing the state of a control. |
Examples:
1.
// 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.
// Example 2.
// If the control was already added to the map using a key from control.storage.
myMap.controls.add('zoomControl', {
size: "large"
});
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from IControl. |
Events
Name |
Description |
Change to the object options. Inherited from ICustomizable. |
|
The parent object reference changed. Data fields:
Inherited from IChild. |
Methods
Name |
Returns |
Description |
getMap() |
Returns reference to the map. |
|
IControlParent|null |
Returns link to the parent object, or null if the parent element was not set. Inherited from IControl. |
|
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. |
Methods details
getMap
{Map} getMap()
Returns reference to the map.