GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Great-circle distance in metres, scalar-argument form.

      Thin adapter over the canonical haversineDistance — it exists only because the filter predicates carry coordinates as loose scalars rather than {lat, lng} pairs.

      ⚠️ The unit is part of the contract. This used to be described as a "fallback for when GeoLeaf.Utils is not loaded", and route-filter duly preferred GeoLeaf.Utils.getDistance when present — but that one returns kilometres, so the proximity radius silently shifted by a factor of 1000 depending on load order (KERNEL S11). Never make this interchangeable with a kilometre-returning function.

      Parameters

      • lat1: number

        Latitude of the first point, decimal degrees.

      • lng1: number

        Longitude of the first point, decimal degrees.

      • lat2: number

        Latitude of the second point, decimal degrees.

      • lng2: number

        Longitude of the second point, decimal degrees.

      Returns number

      The distance in metres.