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);

Detailed example.

Constructor

new MMapZoomControl(props, options?)

Constructor parameters

Parameter

Type

Description

props

MMapZoomControlProps

Value of input props.

options?

ComplexOptions<MMap>

Optional object parameters.

Inherited from

MMapComplexEntity.constructor

new MMapZoomControl(props, children?, options?)

Constructor parameters

Parameter

Type

props

MMapZoomControlProps

children?

GenericEntity<unknown, {}, MMap>[]

options?

Omit<ComplexOptions<MMap>, "children">

Inherited from

MMapComplexEntity.constructor

Props

MMapZoomControlProps: Object

Parameters

Parameter

Type

Description

duration?

number

Duration of location animation on the map.

easing?

EasingFunctionDescription

Function for easing the animation of the location on the map.

Methods

update

update(changedProps): void

Parameter

Type

Description

changedProps

Partial<MMapZoomControlProps>

New props values.

Returns

void

Inherited from

MMapComplexEntity.update