leaflet-measure-distance
v0.0.2
Published
Leaflet measure control =======================
Downloads
12
Readme
leaflet-measure-distance
Measure distances interactively on a leaflet map.
Adds a leaflet control which allows you to activate an interactive mode to measure and annotate distances on the map.
The default units are kilometers, however you can supply an arbitrary scale factor (from meters) and label to support your prefered units.
Example use:
Default: kilometers
:
const map = new L.Map("map", {
measureControl: {
enabled: true,
},
});
e.g.: nautical miles
:
const map = new L.Map("map", {
measureControl: {
enabled: true,
unitLabel: "nm",
unitFactor: 1852,
},
});
e.g.: meters
:
const map = new L.Map("map", {
measureControl: {
enabled: true,
unitLabel: "m",
unitFactor: 1,
},
});
For a demo see here.
License
CSIRO Open Source Software Licence Agreement (variation of the BSD / MIT License)