TomTom Maps for JavaScript
    Preparing search index...

    Variable avoidableTypesConst

    avoidableTypes: readonly [
        "tollRoads",
        "motorways",
        "ferries",
        "unpavedRoads",
        "carpools",
        "alreadyUsedRoads",
        "borderCrossings",
        "tunnels",
        "carTrains",
        "lowEmissionZones",
    ] = ...

    Array of all available route avoidance options.

    This constant defines the complete set of road/route features that can be avoided during route calculation. Use this to derive the Avoidable type or to validate user input against supported avoidance options.

    This is a readonly tuple used as the source of truth for valid avoidance types. The Avoidable type is derived from this array to ensure type safety.

    // Check if a string is a valid avoidance type
    const userInput = 'tollRoads';
    if (avoidableTypes.includes(userInput as Avoidable)) {
    // userInput is valid
    }

    // Iterate over all available options
    avoidableTypes.forEach(type => {
    console.log(`Available option: ${type}`);
    });