Ruler | 2GIS Documentation

Ruler

In order to use this functionality, you first need to obtain a Map API key. You can do so by filling in the form at dev.2gis.com.

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