YMapZoomControl
The YMapZoomControl class displays a control for changing the map scale.
Note
This class is a JS API package component and provides additional features not included in the core API.
To integrate the package, follow the instructions.
The following parameters are used to set up the map scale:
easing. Possible values:linear,ease,ease-in,ease-out,ease-in-out.zoomRange. If the current zoom level is different from this setting, the zoom buttons are locked.
Usage example
Example 1
Using the easing parameter:
const map = new YMap(element, {
location: {center: [37.588144, 55.733842], zoom: 14}
});
const controls = new YMapControls();
controls.addChild(
new YMapZoomControl({
easing: 'linear'
})
);
map.addChild(controls);
Example 2
Using the easing and zoomRange parameters:
const map = new YMap(element, {
zoomRange: {min: 1, max: 5},
location: {center: [37.588144, 55.733842], zoom: 4}
});
const controls = new YMapControls();
controls.addChild(
new YMapZoomControl({
easing: 'linear'
})
);
map.addChild(controls);
Constructor
new YMapZoomControl(props, options?)
Constructor parameters
|
Parameter |
Type |
Description |
|
|
Value of input |
|
|
|
Optional object parameters. |
Inherited from
new YMapZoomControl(props, children?, options?)
Constructor parameters
|
Parameter |
Type |
|
|
|
|
|
|
|
|
|
Inherited from
Props
YMapZoomControlProps: Object
Parameters
|
Parameter |
Type |
Description |
|
|
|
Duration of location animation on the map. |
|
|
Function for easing the animation of the location on the map. |
Methods
update
update(changedProps): void
|
Parameter |
Type |
Description |
|
|
New |
Returns
void