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

Detailed example.

Constructor

new YMapZoomControl(props, options?)

Constructor parameters

Parameter

Type

Description

props

YMapZoomControlProps

Value of input props.

options?

ComplexOptions<YMap>

Optional object parameters.

Inherited from

YMapComplexEntity.constructor

new YMapZoomControl(props, children?, options?)

Constructor parameters

Parameter

Type

props

YMapZoomControlProps

children?

GenericEntity<unknown, {}, YMap>[]

options?

Omit<ComplexOptions<YMap>, "children">

Inherited from

YMapComplexEntity.constructor

Props

YMapZoomControlProps: 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<YMapZoomControlProps>

New props values.

Returns

void

Inherited from

YMapComplexEntity.update