MMapScaleControl

The MMapScaleControl class displays a control that shows the map scale in various measurement units.

Usage example

Add a scale control to the lower-left part of the map:

const scaleControl = new MMapScaleControl({});
const controls = new MMapControls({position: 'bottom left'}, [scaleControl]);
map.addChild(controls)

In addition, you can display the built-in scale control on the map using the showScaleInCopyrights props:

const map = new MMap(document.getElementById('map-root'), {
   showScaleInCopyrights: true,
   location: {center: [37.622504, 55.753215], zoom: 10}
 });

Detailed example.

Constructor

new MMapScaleControl(props)

Constructor parameters

Parameter

Type

props

MMapScaleControlProps

Redefines

MMapComplexEntity.constructor

Props

MMapScaleControlProps: Object

Parameters

Parameter

Type

Description

maxWidth?

number

Maximum scale width in pixels

unit?

UnitType

Measurement units for the scale

Methods

update

update(changedProps): void

Parameter

Type

Description

changedProps

Partial<MMapScaleControlProps>

New props values.

Returns

void

Inherited from

MMapComplexEntity.update