---
title: "haversineCumulatedDistanceWgs84 | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function haversineCumulatedDistanceWgs84

-   haversineCumulatedDistanceWgs84(positions: [Position](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Position/)\[\]): number\[\][](#haversinecumulateddistancewgs84)
    
    Compute the cumulated distance for each position of an array of positions. For I positions, there are I-1 distance, hence the distance at i corresponds to the distance from the (i-1)th position to ith
    
    #### Parameters
    
    -   positions: [Position](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Position/)\[\]
    
    #### Returns number\[\]
