On this page

Function getAverageDistance

  • Calculates the average distance between points in an array of coordinates.

    This function computes the average distance between consecutive points in the array. It uses the LngLat class from MapLibre to calculate distances based on geographical coordinates.

    Parameters

    • arr: [number, number][]

      An array of coordinate pairs [longitude, latitude]

    Returns number

    The average distance between points in the array

Was this helpful?
SDK JS
Reference
getAverageDistance