measureLineDistance
Measures the total length (kilometres) of a line drawn through positions,
in order.
This is a function exported by @mapcairn/core, checked against version 0.2.0.
Signature
import { measureLineDistance } from "@mapcairn/core";
function measureLineDistance(positions: readonly Position_2[]): number | null;
Parameters
positions(readonly Position_2[]): Vertices as[lon, lat], e.g. points a user has clicked while measuring on a map.
Returns
number | null: The summed distance across every segment, or null if there are
fewer than two positions to form a segment from.