code: function getLengthInternal(coordinates, radius) {
    let length = 0;
    for (let i = 0, ii = coordinates.length; i < ii - 1; ++i) {
      length += getDistance(coordinates[i], coordinates[i + 1], radius);
    }
    return length;
  }
docs: Get the cumulative great circle length of linestring coordinates (geographic).
  @param {Array} coordinates Linestring coordinates.
  @param {number} radius The sphere radius to use.
  @return {number} The length (in meters).