Vehicle restrictions

VERSION 1.25.3

Vehicle restrictions are used commonly for trucks, delivery vans, and scooter drivers. Climate and pollution regulations are also introducing more rules for cars, such as electric vehicles (EVs) and cars that fail to meet various low-emission vehicle requirements.

The SDK allows you to apply these restrictions based on a user-defined vehicle profile.

The Vehicle Restrictions API is available through the TomTomMap object. To enable vehicle restrictions in your app, load the predefined StandardStyles.VEHICLE_RESTRICTIONS.

1tomTomMap.loadStyle(
2 StandardStyles.VEHICLE_RESTRICTIONS,
3 onStyleLoadedCallback,
4)

The next step is to define your vehicle. This can be done using the Vehicle model.

1val truck =
2 Vehicle.Truck(
3 dimensions =
4 VehicleDimensions(
5 weight = Weight.kilograms(6420),
6 axleWeight = Weight.kilograms(2200),
7 length = Distance.centimeters(805),
8 width = Distance.centimeters(260),
9 height = Distance.centimeters(330),
10 ),
11 // You can define characteristics of your vehicle's load like Hazmat and ADR
12 hazmatClasses =
13 setOf(
14 HazmatClass.IntlExplosive,
15 HazmatClass.UnClass1Explosive,
16 HazmatClass.UnClass2Gas,
17 HazmatClass.UnClass3FlammableLiquid,
18 ),
19 adrTunnelRestrictionCode = AdrTunnelRestrictionCode.B,
20 )

To show restrictions:

tomTomMap.showVehicleRestrictions(truck)

Vehicle Restrictions

To hide restrictions:

tomTomMap.hideVehicleRestrictions()

To apply changes after updating the vehicle parameters:

1val newDimension = VehicleDimensions(
2 weight = Weight.kilograms(8000),
3 axleWeight = Weight.kilograms(2200),
4 length = Distance.centimeters(805),
5 width = Distance.centimeters(260),
6 height = Distance.centimeters(330),
7)
8tomTomMap.updateVehicle(
9 Vehicle.Truck(
10 dimensions = newDimension,
11 hazmatClasses =
12 setOf(
13 HazmatClass.IntlExplosive,
14 HazmatClass.UnClass1Explosive,
15 HazmatClass.UnClass2Gas,
16 HazmatClass.UnClass3FlammableLiquid,
17 ),
18 adrTunnelRestrictionCode = AdrTunnelRestrictionCode.B,
19 ),
20)

Low-emission zone


Low-Emission Zone

A low-emission zone is an area that restricts access to vehicles based on the level of pollutants they emit. By default, you can enable a low-emission zone using the predefined style StandardStyles.VEHICLE_RESTRICTIONS.

Supported vehicle restriction types

The following table shows the supported vehicle restriction types:

Europe, Canada

Norway, Iceland, Sweden

US

No access


tt restriction flow notrucks EU white


tt restriction flow notrucks EU yellow


tt restriction flow notrucks US

Height limit


tt restriction physical height EU white


tt restriction physical height EU yellow


tt restriction physical height US

Width limit


tt restriction physical width EU white


tt restriction physical width EU yellow


tt restriction physical width US

Length limit


tt restriction physical length EU white


tt restriction physical length EU yellow


tt restriction physical length US

Weight limit


tt restriction physical weight EU white


tt restriction physical weight EU yellow


tt restriction physical weight US

Axle weight limit


tt restriction physical axleweight EU white


tt restriction physical axleweight EU yellow


tt restriction physical axleweight EU white

Hazardous materials


tt restriction hazmat nodangerousgoods EU white


tt restriction hazmat nodangerousgoods EU yellow


tt restriction hazmat hazardousmaterials US

Goods harmful to water


tt restriction hazmat waterpollutants EU white


tt restriction hazmat waterpollutants EU yellow

Does not occur

Explosive materials


tt restriction hazmat explosivematerials EU white


tt restriction hazmat explosivematerials EU yellow

Does not occur

ADR (B, C, D, E)


tt restriction ADR shield EU white


tt restriction ADR shield EU yellow

Does not occur

UN dangerous goods class

The UN dangerous goods class describes the categories of dangerous cargo as follows:

Explosives, Gases, Flammable Liquids, Flammable Solids, Oxidizing And Organic Substance, Toxic And Infectious Substance, Radioactive Material, Corrosives, Miscellaneous Dangerous Goods


tt restriction hazmat 1 explosive US


"


"


"


"


"


"


"


"

You can find those categories defined here: HazmatClass.

Next steps

Since you have learned how to work with vehicle restrictions, here are some recommended next steps: