A better scalebar for leaflet maps
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
L.Control.BetterScale.css
L.Control.BetterScale.js Fix for metric May 4, 2017
README.md Update README.md Sep 30, 2016
index.html Update index.html Sep 30, 2016

README.md

leaflet-betterscale

A better scalebar for leaflet maps that is more GIS-like with alternating black/white bars.

Example

https://daniellsu.github.io/leaflet-betterscale/

All that is required is to include the CSS, the JS and the following line of code:

Simple example

var map = L.map('map').setView([30.182505,-93.318665], 12);        
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {    
		maxZoom: 18,
		attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
L.control.betterscale().addTo(map);

Options

  • The options are the exact same as the leaflet built-in scale control, L.Control.Scale().