@watergis/maplibre-gl-terradraw
    Preparing search index...
    • Converts a distance in kilometers to the appropriate unit (km, m, or cm).

      • If the value is 1 km or more, it returns the value in kilometers.
      • If the value is less than 1 km but 1 meter or more, it returns the value in meters.
      • If the value is less than 1 meter, it returns the value in centimeters.

      Parameters

      • distance: number

        The distance in kilometers.

      Returns { distance: number; unit: "km" | "m" | "cm" }

      the converted value and unit.