RulerControl | MapGL | 2GIS Documentation
MapGL JS API

RulerControl

A class that provides a ruler control on the map.

Extends: Control
new constructor(map, options, enabled)

Example:

const control = new mapgl.RulerControl(map, {{ position: 'centerRight' }});
control.getRuler().setPoints([
    [55.31878, 25.23584],
    [55.35878, 25.23584],
    [55.35878, 25.26584],
]);
Parameters
map
Map

The map instance.

options
ControlOptions

Control initialization options.

enabled
boolean

Specifies whether the ruler should be enabled.

Returns
Methods