MMapScaleControl
The MMapScaleControl
class displays a control that shows the map scale in various measurement units.
Usage example
vanilla
react
vue
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}
});
Constructor
new MMapScaleControl(props
)
Constructor parameters
Parameter |
Type |
|
Redefines
Props
MMapScaleControlProps: Object
Parameters
Parameter |
Type |
Description |
|
|
Maximum scale width in pixels |
|
Measurement units for the scale |
Methods
update
update(changedProps
): void
Parameter |
Type |
Description |
|
New props values. |
Returns
void