addSimpleMeasureTool
FitFileViewer - API Documentation v29.4.0
FitFileViewer - API Documentation / utils/maps/controls/mapMeasureTool / addSimpleMeasureTool
Function: addSimpleMeasureTool()
addSimpleMeasureTool(
map:any,controlsDiv:HTMLElement):void
Defined in: utils/maps/controls/mapMeasureTool.js:18
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.
Typing approach: Leaflet types are treated as any to avoid pulling in type definitions in this JS file. Internal collections are explicitly typed to remove implicit-any errors under checkJs.
Parametersβ
mapβ
any
Leaflet map instance (L.Map)
controlsDivβ
HTMLElement
Container element for map action buttons
Returnsβ
void