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

    Type Alias RouteType

    RouteType: typeof routeTypes[number]

    The optimisation strategy for route calculation.

    It sets what the routing engine optimises for, and each type produces routes suited to different use cases.

    • fast minimises travel time while staying practical.

      • Prefers major roads and highways
      • Avoids unnecessary detours and shortcuts on minor roads
      • Best for most everyday use cases (commuting, business travel)
    • short balances 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 minimises fuel or energy consumption.

      • Optimizes for least energy use
      • Avoids rapid acceleration/deceleration
    • thrilling plans 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';