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

    Type Alias RouteStateProps

    The props of a displayed route's visual style.

    They control whether a route appears selected (highlighted) or deselected (dimmed). showRoutes selects the route at selectedIndex, the first by default, and only selectRoute changes the selection after that.

    Style states:

    • selected: Primary route with full color saturation and emphasis
    • deselected: Alternative routes shown dimmed/grayed out
    // Main selected route
    const selectedStyle: RouteStateProps = {
    routeState: 'selected'
    };

    // Alternative route
    const alternativeStyle: RouteStateProps = {
    routeState: 'deselected'
    };
    type RouteStateProps = {
        routeState: "selected" | "deselected";
    }
    Index
    routeState: "selected" | "deselected"

    The route's visual state.

    It sets how the route renders on the map:

    • selected: Full color, more prominent (typically the chosen route)
    • deselected: Greyed out, less prominent (alternative routes)