somenxavier somenxavier - 1 month ago 5
Javascript Question

How to display the map scale in leaflet.js

I wonder how to display the scale map in leafleat.js. That is: I want this
enter image description here
instead of this
enter image description here
(taken to leaflet tutorial). See the left corner of the picture.

Answer

You can take use of L.control.scale(). Here is an EXAMPLE. In it's options you can set width, position and scale system.