Skip to main content

Function: addSimpleMeasureTool()

function addSimpleMeasureTool(
map: Map,
controlsDiv: HTMLElement,
runtime?: MapMeasureToolRuntime
): void;

Defined in: utils/maps/controls/mapMeasureTool.ts:272

Add a simple point-to-point measurement tool (two clicks) to a Leaflet map. Creates a button in the provided controls container; when activated, the next two clicks on the map will display straight-line distance (meters/km + miles). Subsequent clicks clear the prior measurement and allow a new one.

Parameters​

map​

Map

Leaflet map instance.

controlsDiv​

HTMLElement

Container element for map action buttons.

runtime?​

MapMeasureToolRuntime = ...

Returns​

void