See Leaflet.measure or Leaflet.MeasureControl