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

    Variable avoidableTypesConst

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

    All the road and route features that route calculation can avoid.

    Use it to derive the Avoidable type or to validate user input against the supported avoidance options.

    This readonly tuple is the source of truth for valid avoidance types. The Avoidable type derives from it, for 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}`);
    });