Ruler | Urbi Documentation
MapGL JS API

Ruler

The Ruler plugin allows you to add a ruler to the map and measure distances between points, areas and perimeters of polygons.

Next, you need to include the Ruler plugin in your project. To do this, add the following line after the main MapGL script:

<script src="https://unpkg.com/@2gis/mapgl-ruler@^2/dist/ruler.js"></script>

Or you can install the needed package using npm:

npm install @2gis/mapgl-ruler

To start using the plugin, check the following resources: