Table of Contents

TMS FNC Toll Cost — Guides

Vehicle and emission options

Set Options (TTMSFNCTollCostOptions) to specify vehicle class, fuel type, emission standard, and currency preference. These values affect the returned toll calculations.

Configuring vehicle travel info

Toll tariffs for trucks and commercial vehicles typically vary by axle count, weight, height, and emission class — a light passenger car and a heavy truck can be charged very differently for the same route. Use Options.TravelInfo (TTMSFNCTollCostTravelInfo) to describe the vehicle before calling GetTollCost or GetTollCostResult, so the service applies the correct vehicle-specific tariff instead of the default car profile:

  • VehicleAxles — number of axles on the vehicle (default 2).
  • VehicleWeight — vehicle weight in kilograms (default 3499).
  • VehicleHeight — vehicle height in centimeters (default 199).
  • VehicleEmissionType — Euro emission standard (etUnknown through etEuroEev).
  • VehicleCO2Class — CO2 emission class (co2Unknown through co2Class5).

Pair the travel info with a matching TravelMode (for example ttHeavyTruck) when calling GetTollCost so the request and the vehicle description are consistent:

procedure TForm1.ConfigureTruckTravelInfo;
begin
  { Describe the vehicle so the toll cost service can apply truck-specific tariffs. }
  TMSFNCTollCost1.Options.TravelInfo.VehicleAxles := 5;
  TMSFNCTollCost1.Options.TravelInfo.VehicleWeight := 12000;
  TMSFNCTollCost1.Options.TravelInfo.VehicleHeight := 400;
  TMSFNCTollCost1.Options.TravelInfo.VehicleEmissionType := etEuro6;
  TMSFNCTollCost1.Options.TravelInfo.VehicleCO2Class := co2Class1;

  { Use a truck travel mode so the request and the travel info agree on vehicle class. }
  TMSFNCTollCost1.GetTollCost(
    CreateCoordinate(51.2213, 4.4051),
    CreateCoordinate(50.8503, 4.3517),
    nil, 'route-1', nil, ttHeavyTruck);
end;

Result handling

Handle OnGetTollCost to receive a TTMSFNCTollCostItems collection. Each TTMSFNCTollCostItem includes:

  • Steps — per-segment toll amounts (TTMSFNCTollCostStep).
  • Systems — toll collection systems encountered (TTMSFNCTollCostSystem).
  • TravelInfo — emission and distance summary (TTMSFNCTollCostTravelInfo).

Service backends

Set the Service property to choose the toll data provider. Coverage and pricing models vary by region and provider.

See also