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

    Type Alias RoutingModuleConfig

    RoutingModuleConfig: MapModuleCommonConfig & {
        chargingStops?: ChargingStopsConfig;
        countryCrossings?: CountryCrossingConfig;
        displayUnits?: DisplayUnits;
        layers?: RouteLayersConfig;
        sections?: SectionsDisplayConfig;
        summaryBubbles?: { visible?: boolean };
        theme?: RouteTheme;
        waypoints?: WaypointsConfig;
    }

    Configuration options for the routing module.

    Type Declaration

    • OptionalchargingStops?: ChargingStopsConfig

      Configuration for the charging stops source and layers to display them on the map.

      Controls how charging stops source data and/or layer configs are processed to rendering them the map.

    • OptionalcountryCrossings?: CountryCrossingConfig

      Appearance of the border crossings along the route.

      Read off the route's country sections, so a route carrying none draws none.

    • OptionaldisplayUnits?: DisplayUnits

      Units for displaying distances in route summaries and instructions.

      Overrides the global configuration setting for display units. Affects distance values shown in route summaries and turn-by-turn instructions.

      Available options:

      • metric - Kilometers and meters
      • imperial - Miles and feet

      "metric"

    • Optionallayers?: RouteLayersConfig

      Custom layer styling configuration.

      • Overrides the default layer styling with custom specifications.
      • You must provide complete layer specifications for any layers you wish to customize.
      • You can still reuse the default configurations if you want incremental changes. See: defaultRoutingLayers.
      • Any layer not specified will continue to use its default styling.
      • Use this only if you need fine MapLibre control on how some parts of the route are displayed.
    • Optionalsections?: SectionsDisplayConfig

      Appearance of the route sections, keyed by section type.

      Covers every section type the module draws, on the same knobs: draw it or not, its colour, opacity, width, whether it bands the route or stands in for its line, its line pattern and its icon.

      The types whose stretches are sparse and consequential draw themselves — carTrain, ferry, lowEmissionZone, tollRoad, tollVignette, traffic, tunnel and vehicleRestricted — and switch off with { visible: false }. The rest switch on with { visible: true }: a type covering most of a route buries the route line.

      layers.sections takes full MapLibre layer specs for the same types, for anything these knobs cannot express.

    • OptionalsummaryBubbles?: { visible?: boolean }

      Configuration for the route summary bubbles displayed on the map.

      Summary bubbles show key route information (distance, duration, traffic delay) as visual overlays positioned along the route.

      • Optionalvisible?: boolean

        Controls the visibility of route summary bubbles on the map.

        true
        
    • Optionaltheme?: RouteTheme

      Main styling configuration for the route visualization.

      • Provides high-level styling options that affect the overall appearance of the route, such as the primary color used for route lines and waypoints.
      • Can be overwritten by more specific layer styling configurations.
    • Optionalwaypoints?: WaypointsConfig

      Configuration for the waypoints source and layers to display them on the map.

      Controls how waypoint source data and/or layer configs are processed to rendering them the map.

    Provides customization options for route visualization and behavior, including display units, waypoint handling, and layer styling.