@pond-ts/fit API Reference
    Preparing search index...

    Function polylineSlice

    • The sub-polyline covering [startMeters, endMeters] of the route, with the endpoints interpolated to the exact distances (so a highlight begins and ends where the segment does, not at the nearest vertex) plus every vertex strictly between. Range is clamped to the track and normalized (start ≤ end). Returns the two interpolated endpoints for a zero-length range, [] for an empty polyline.

      opts.domainTotal is the length of the ruler start/end are measured in when that differs from this polyline's own length — laps come in FIT odometer metres and splits in raw-track haversine metres, but the polyline is Douglas–Peucker-simplified and a fraction shorter, so feeding those metres in raw would drift the highlight (≈1 km late on a 180 km ride). Given domainTotal, the window is rescaled proportionally onto the polyline so the same FRACTION of the route is sliced. opts.cum, if passed, MUST correspond to polyline.

      Parameters

      • polyline: readonly [number, number][]
      • startMeters: number
      • endMeters: number
      • opts: { cum?: number[]; domainTotal?: number } = {}

      Returns [number, number][]