TomTom Maps for JavaScript
    Preparing search index...

    Function getCoordinateAtRouteProgress

    • Returns the geographic coordinate and cumulative progress values at the point along a route identified by a RouteProgressQuery.

      Parameters

      • route: Route

        The route to query. Must contain properties.progress data.

      • query: RouteProgressQuery

        A discriminated union — provide exactly one of:

        • { traveledTimeInSeconds } — elapsed seconds from route start
        • { traveledDistanceInMeters } — meters traveled from route start
        • { clockTime } — absolute Date; elapsed seconds are derived from route.summary.departureTime

      Returns RouteCoordinateAtProgress | undefined

      Interpolated RouteCoordinateAtProgress, or undefined when:

      • the route has no progress data
      • clockTime is before the route departure time
      • the progress data is incomplete for the requested position
      // By elapsed time
      const pos = getCoordinateAtRouteProgress(route, { traveledTimeInSeconds: 600 });

      // By distance
      const pos = getCoordinateAtRouteProgress(route, { traveledDistanceInMeters: 5000 });

      // By clock time
      const pos = getCoordinateAtRouteProgress(route, { clockTime: new Date('2025-06-01T09:30:00Z') });