0.0.2 • Published 2 years ago

leaflet-measure-distance v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

leaflet-measure-distance NPM version NPM Downloads

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)

0.0.2

2 years ago

0.0.1

2 years ago