Measurement ⭐
Measurement ⭐
Calculates the measurement of a layer while drawing and editing. Exclusive for Leaflet-Geoman Pro ⭐
map.pm.setGlobalOptions({ measurements: { measurement: true, displayFormat: 'metric', ... } })
See the available options in the table below.
Option | Default | Description |
---|---|---|
measurement | true | Enable measurement calculation. |
showTooltip | true | Shows the tooltip during draw and edit. |
showTooltipOnHover | true | Shows the tooltip when hovering a finished layer. |
displayFormat | metric | Displayed format in the tooltip metric or imperial . |
totalLength | true | Shows the total length in the tooltip Line . |
segmentLength | true | Shows the segment length in the tooltip Line , Polygon . |
area | true | Shows the area in the tooltip Polygon , Rectangle , Circle , CircleMarker . |
radius | true | Shows the radius in the tooltip Circle , CircleMarker . |
perimeter | true | Shows the perimeter in the tooltip Polygon , Rectangle , Circle , CircleMarker . |
height | true | Shows the height in the tooltip Rectangle . |
width | true | Shows the width in the tooltip Rectangle . |
coordinates | true | Shows the coordinates in the tooltip Marker , CircleMarker and the current dragged marker while drawing / editing. |
The calculated measurements are available on layer.pm.measurements
.
You can also calculate measurements of any layer with:
L.PM.Utils.getMeasurements(layer, map, displayFormat); // displayFormat: 'metric' | 'imperial'
Examples
Measurement enabled with metric display format:
Loading...
Measurement enabled with imperial display format:
Loading...