TomTom Maps for JavaScript
    Preparing search index...

    Type Alias DepartArriveParams<Option>

    Departure or arrival time specification for route planning.

    Allows specifying either when to depart from the origin or when to arrive at the destination. The routing engine calculates the route optimized for that specific time window, considering traffic patterns for that time of day.

    Traffic conditions vary significantly by:

    • Time of day (rush hour vs off-peak)
    • Day of week (weekday vs weekend)
    • Special events or holidays

    Specifying a departure or arrival time enables the router to:

    • Use appropriate traffic data for that time
    • Plan around rush hour or quiet periods
    • Calculate accurate arrival/departure times
    • Account for time-dependent road restrictions

    Important Notes:

    • Times are processed in the timezone of the origin/destination
    // Depart at specific time (morning commute)
    const departParams: DepartArriveParams = {
    option: 'departAt',
    date: new Date('2025-10-20T08:00:00Z')
    };

    // Arrive by specific time (catch a flight)
    const arriveParams: DepartArriveParams = {
    option: 'arriveBy',
    date: new Date('2025-10-20T14:00:00Z')
    };

    // Plan route avoiding rush hour
    const offPeakDepart: DepartArriveParams = {
    option: 'departAt',
    date: new Date('2025-10-20T10:30:00Z') // After morning rush
    };
    type DepartArriveParams<Option extends DepartArriveOption = DepartArriveOption> = {
        date: Date;
        option: Option;
    }

    Type Parameters

    • Option extends DepartArriveOption = DepartArriveOption

      Whether this specifies departure or arrival time

    Index

    Properties

    Properties

    date: Date

    The date and time to depart or arrive.

    If past dates are supplied or dates that are impossible to achieve (e.g., an imminent arrival date for a very long route), the system will default to departing immediately.

    Times should be specified in ISO 8601 format or as JavaScript Date objects.

    option: Option

    Whether to specify a departure or arrival time.

    • departAt: Calculate route from this departure time forward
    • arriveBy: Calculate route backward to arrive by this time