Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 924 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 924 Bytes

Leaflet measure control

Adds a button below the map's zoom controls that allows you to activate an interactive mode to measure distances on the map.

Initialise control

  • Add CSS and JS
	<link rel="stylesheet" href="leaflet.measure/leaflet.measure.css" />
	<script src="leaflet.measure/leaflet.measure.js"></script>
  • Add Measure Control
  • as an option when creating map
	var map = L.map("map", { measureControl: true });
  • or after map instantiation
	var measureControl = new L.Control.Measure({
		position: 'topleft',
		measureUnit: 'km'
		measureUnitPrecision: 1
	});
	measureControl.addTo(map);

Demos