This is the documentation of version 0.64.0. Go to the latest version, 1.0.0.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias VehicleParameters

    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: Maximum speed applied during route planning

    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:

    • Weight restrictions matter (trucks, vans)
    • Accurate range prediction needed
    • EV routing with charging stops
    // Generic vehicle with just dimensions
    const van: VehicleParameters = {
    model: {
    dimensions: {
    weightKG: 3500
    }
    }
    };

    // 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
    }
    }
    };

    // Speed-limited truck
    const truck: VehicleParameters = {
    model: {
    dimensions: {
    weightKG: 40000
    }
    },
    restrictions: {
    maxSpeedKMH: 80
    }
    };