TomTom Maps for JavaScript
    Preparing search index...

    Type Alias VehicleParameters

    VehicleParameters: (
        GenericVehicleParams
        | CombustionVehicleParams
        | ElectricVehicleParams
    ) & VehicleRestrictions

    Object describing vehicle details for routing.

    Combines all vehicle-related parameters including:

    • Model: Static properties (dimensions, engine specs)
    • State: Current conditions (fuel/charge level, heading)
    • Preferences: Routing preferences (charging stops, etc.)
    • Restrictions: Cargo and usage restrictions

    Three Types:

    1. Generic: Basic vehicle without engine-specific features
    2. Combustion: Fuel-powered with consumption modeling
    3. Electric: Battery-powered with charging stop optimization

    When to Specify:

    • Size restrictions matter (trucks, vans)
    • Accurate range prediction needed
    • EV routing with charging stops
    • Hazardous material transport
    • Commercial vehicle routing
    // Generic vehicle with just dimensions
    const van: VehicleParameters = {
    model: {
    dimensions: {
    heightMeters: 2.5,
    weightKG: 3500
    }
    },
    restrictions: {
    commercial: true
    }
    };

    // Combustion vehicle with fuel tracking
    const fuelCar: VehicleParameters = {
    engineType: 'combustion',
    model: {
    dimensions: { weightKG: 1500 }
    },
    state: {
    currentFuelInLiters: 45
    }
    };

    // Electric vehicle with charging
    const ev: VehicleParameters = {
    engineType: 'electric',
    model: {
    engine: {
    consumption: {
    charging: {
    maxChargeKWH: 75,
    connectorTypes: ['IEC_62196_TYPE_2']
    }
    }
    }
    },
    state: {
    currentChargePCT: 80
    },
    preferences: {
    chargingPreferences: {
    minChargeAtDestinationPCT: 20,
    minChargeAtChargingStopsPCT: 10
    }
    }
    };

    // Hazmat truck
    const hazmatTruck: VehicleParameters = {
    model: {
    dimensions: {
    heightMeters: 4.0,
    weightKG: 40000
    }
    },
    restrictions: {
    loadTypes: ['USHazmatClass3'],
    commercial: true,
    maxSpeedKMH: 80
    }
    };