measureShape
The measures of a shape along the geodesic (WGS 84, never flat pixels), using the same maths as the Measure tool. A polygon draft with fewer than three vertices has a length but no area. A circle's area is that of the spherical cap and its length the circumference, not those of the polygon it is exported as.
This is a function exported by @mapcairn/core, checked against version 0.2.0.
Signature
import { measureShape } from "@mapcairn/core";
function measureShape(shape: DrawShape): ShapeMeasure;
Parameters
shape(DrawShape)
Returns
ShapeMeasure