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

    Type Alias TrafficInput

    TrafficInput: "live" | "historical"

    How traffic conditions factor into routing and travel time estimates.

    • live uses real-time and historical traffic.

      • Includes current traffic jams and incidents
      • Considers short-term and long-term road closures
      • Most accurate for immediate departures
      • Updates with current conditions
    • historical uses typical traffic patterns only.

      • Based on historical data for time of day/week
      • Ignores current traffic conditions
      • Good for future trip planning
      • More predictable for scheduled departures
    // Route considering current traffic (departing now)
    const trafficMode: TrafficInput = 'live';

    // Route based on typical patterns (planning ahead)
    const plannedRoute: TrafficInput = 'historical';