The route whose properties.progress will be used for interpolation.
Zero-based index of the segment start in the route's coordinate array.
Zero-based index of the segment end in the route's coordinate array.
A RouteSegmentProgress object, or undefined when either index cannot
be interpolated (see calculateProgressAtRoutePoint for the full list of conditions).
const result = getRouteProgressBetween(route, 10, 60);
if (result) {
console.log(`Segment starts ${result.start.distanceInMeters} m from route origin`);
console.log(`Segment ends ${result.end.distanceInMeters} m from route origin`);
console.log(`Segment length ${result.delta.distanceInMeters} m`);
console.log(`Segment takes ${result.delta.travelTimeInSeconds} s`);
}
Calculates progress measurements for a segment between two arbitrary points on the route path.
Calls calculateProgressAtRoutePoint for both indices and exposes the start and end measurements together with the delta (distance and time covered between them).