Vehicle Restrictions

VERSION 1.20.1

Vehicle restrictions are used commonly for trucks, delivery vans, and scooter drivers. Climate/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 provides the ability to apply those restrictions based on the user-defined vehicle profile.

The Vehicle Restrictions API is available under the TomTomMap object. To enable vehicle restrictions in your app, load the pre-defined 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:

val newDimension = truck.dimensions?.copy(weight = Weight.kilograms(8000))
tomTomMap.updateVehicle(truck.copy(dimensions = newDimension))

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 pre-defined style StandardStyles.VEHICLE_RESTRICTIONS.

Supported vehicle restriction types

The following table shows the supported vehicle restriction types:

Europe, CanadaNorway, Iceland, SwedenUS

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 weight EU white


tt restriction physical weight EU yellow


tt restriction physical weight 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

image::https://developer.tomtom.com/assets/downloads/tomtom-sdks/android/maps/vr/tt_restriction_hazmat_1_explosive_US.png[,48] image::https://developer.tomtom.com/assets/downloads/tomtom-sdks/android/maps/vr/tt_restriction_hazmat_2_flammablegas_US.png

You can find those categories defined here HazmatClass.

Next steps

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