TomTom Maps for JavaScript
    Preparing search index...

    Type Alias RouteType

    RouteType: typeof routeTypes[number]

    Route optimization strategy for route calculation.

    Determines what the routing engine optimizes for when calculating the route. Each type produces different routes suited to different use cases.

    Route Type Strategies:

    • fast: Minimize travel time while maintaining practicality

      • Prefers major roads and highways
      • Avoids unnecessary detours and shortcuts on minor roads
      • Best for most everyday use cases (commuting, business travel)
    • short: Balance between time and distance

      • Good compromise between speed and mileage
      • May use smaller roads to save distance
      • Useful for short trips or when fuel costs matter
    • efficient: Minimize fuel or energy consumption

      • Optimizes for least energy use
      • Considers vehicle consumption model
      • Avoids rapid acceleration/deceleration
      • Best used with vehicle consumption parameters
    • thrilling: Scenic and engaging routes

      • Prefers curvy, interesting roads
      • Minimizes motorway usage
      • Limited to 900km maximum route length
      • Ideal for motorcycle rides or scenic drives
    // Fastest route for commuting
    const routeType: RouteType = 'fast';

    // Most fuel-efficient route for long trip
    const ecoRoute: RouteType = 'efficient';

    // Scenic route for leisure
    const scenicRoute: RouteType = 'thrilling';