Vehicle Restrictions

VERSION 0.18.1
PUBLIC PREVIEW

Vehicle restrictions are the rules about which vehicles can use which roads. They have often been used to limit where vehicles such as trucks, delivery vans, and scooters can go. Climate and pollution regulations have added more rules, regarding, for example, electric vehicles (EVs) and high-emission vehicles. The Map Display SDK supports applying those restrictions to a specific vehicle as defined by the user.

The Vehicle restrictions API is available under the TomTomMap object. To enable vehicle restrictions in your app, load the pre-defined .restrictionsStyle.

map.styleContainer = .restrictionsStyle

Next, define the vehicle by importing:

import TomTomSDKCommon

This provides access to the Vehicle protocol:

1let dimensions = try? VehicleDimensions(
2 weight: Measurement.tt.kilograms(8000),
3 axleWeight: Measurement.tt.kilograms(4000),
4 length: Measurement.tt.millimeters(8340),
5 width: Measurement.tt.millimeters(4650),
6 height: Measurement.tt.millimeters(3445)
7)
8let vehicle = Truck(
9 maxSpeed: Measurement.tt.kilometersPerHour(120),
10 numberOfAxles: 3,
11 generalLoadType: [.explosiveMaterials, .generalHazardousMaterials, .goodsHarmfulToWater],
12 dangerousGoodsLoadType: [.corrosives, .explosive, .gases],
13 isCommercial: false,
14 combustionEngine: nil,
15 electricEngine: nil,
16 dimensions: dimensions,
17 adrTunnelRestrictionCode: .b,
18 modelID: VehicleModelID("Fancy Truck")
19)

To show restrictions:

try? map.showVehicleRestrictions(vehicle: vehicle)

Vehicle Restrictions

To hide restrictions:

try? map.hideVehicleRestrictions()

To apply changes after updating vehicle parameters:

try? map.updateVehicle(vehicle)

Low emission zone


Low Emission Zone

A low emission zone is enabled by default using the pre-defined .restrictionsStyle.

Supported vehicle restriction types

Europe, Canada Norway, Iceland, Sweden US

No access


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Height limit


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Width limit


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Length limit


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Weight limit


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Axle weight limit


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Hazardous Materials


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

Goods Harmful To Water


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

does not occur

Explosive Materials


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

does not occur

ADR (B, C, D, E)


Supported Vehicle Restriction Types


Supported Vehicle Restriction Types

does not occur

UN Dangerous Goods Class

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


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class


UN Dangerous Goods Class

Next steps

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