MMapZoomControl
The MMapZoomControl
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 MMap(element, {
location: {center: [25.229762, 55.289311], zoom: 14}
});
const controls = new MMapControls();
controls.addChild(
new MMapZoomControl({
easing: 'linear'
})
);
map.addChild(controls);
Example 2
Using the easing
and zoomRange
parameters:
const map = new MMap(element, {
zoomRange: {min: 1, max: 5},
location: {center: [25.229762, 55.289311], zoom: 4}
});
const controls = new MMapControls();
controls.addChild(
new MMapZoomControl({
easing: 'linear'
})
);
map.addChild(controls);
Constructor
new MMapZoomControl(props
, options?
)
Constructor parameters
Parameter |
Type |
Description |
|
Value of input |
|
|
Optional object parameters. |
Inherited from
new MMapZoomControl(props
, children?
, options?
)
Constructor parameters
Parameter |
Type |
|
|
|
|
|
|
Inherited from
Props
MMapZoomControlProps: 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