This is the documentation of version 1.0.0-rc.3. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function getCoordinateAtRouteProgress

    • Returns the geographic coordinate and cumulative progress at the route point a RouteProgressQuery identifies.

      Between progress entries, positions follow the line's length, so equal steps of distance cover equal ground.

      Parameters

      • route: Route

        The route to query, which must contain properties.progress data.

      • query: RouteProgressQuery

        Exactly one of:

        • { traveledTimeInSeconds }, the elapsed seconds from the route start.
        • { traveledDistanceInMeters }, the meters traveled from the route start.
        • { clockTime }, an absolute Date. The elapsed seconds come from route.properties.summary.departureTime.

      Returns RouteCoordinateAtProgress | undefined

      The interpolated RouteCoordinateAtProgress, or undefined when:

      • the route has no progress data
      • clockTime is given but the route has no summary.departureTime
      • clockTime is before the route departure time
      • the progress data is incomplete for the requested position
      const byTime = getCoordinateAtRouteProgress(route, { traveledTimeInSeconds: 600 });
      const byDistance = getCoordinateAtRouteProgress(route, { traveledDistanceInMeters: 5000 });
      const byClock = getCoordinateAtRouteProgress(route, { clockTime: new Date('2025-06-01T09:30:00Z') });