TruckSpecifications class
- Last UpdatedMay 13, 2025
- 5 minute read
TruckSpecifications class
Truck specifications contain vehicle related attributes.
Examples: Dimensions, weight, axle count. Only the fields that are set are considered for restriction handling.
Constructors
- TruckSpecifications([int? grossWeightInKilograms = null, int? weightPerAxleInKilograms = null, WeightPerAxleGroup? weightPerAxleGroup = null, int? heightInCentimeters = null, int? widthInCentimeters = null, int? lengthInCentimeters = null, int? axleCount = null, int? trailerCount = null, TruckType truckType = TruckType.straight, bool isTruckLight = false, int? payloadCapacityInKilograms = null, int? trailerAxleCount = null])
-
Creates a new instance.
grossWeightInKilograms
Truck weight including trailers and shipped goods in kilograms. The provided value must be greater than or equal to 0. By default, it is not set.weightPerAxleInKilograms
Heaviest weight per axle, regardless of axle type or axle group. It is evaluated against all axle weight restrictions, including single axle and tandem axle weight restrictions. The provided value must be greater or equal to 0. By default, it is not set. Note:weight_per_axle_in_kilograms
andweight_per_axle_group
are incompatible. When available for your edition, if both attributes are set, during online RoutingEngine ansdk.routing.RoutingError.INVALID_PARAMETER
error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.weightPerAxleGroup
Allows specification of axle weights in a more fine-grained way thanweight_per_axle_in_kilograms
. This is relevant in countries with signs and regulations that specify different limits for different axle groups, like the USA and Sweden. By default is not set. Note:weight_per_axle_in_kilograms
andweight_per_axle_group
are incompatible. When available for your edition, if both attributes are set, during online RoutingEngine ansdk.routing.RoutingError.INVALID_PARAMETER
error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.heightInCentimeters
Truck height in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.widthInCentimeters
Truck width in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.lengthInCentimeters
Truck length in centimeters. The provided value must be in the range [0, 30000]. By default, it is not set.axleCount
Defines total number of axles in the vehicle. The provided value must be greater than or equal to 2. By default, it is not set. Route calculation: When not set, possible axle count restrictions will not be taken into consideration. Renderingsdk.mapview.TruckProfile
: When set, truck restriction icons for an axle count greater than TruckSpecifications.axleCount will not be displayed. When specifying TruckSpecifications.trailerAxleCount, then TruckSpecifications.axleCount is required and must be greater than TruckSpecifications.trailerAxleCount.trailerCount
Defines number of trailers attached to the vehicle. The provided value must be in the range [0, 255]. By default, it is not set. When specifying TruckSpecifications.trailerAxleCount, then TruckSpecifications.trailerCount is required and must be greater than 0.truckType
Defines the type of truck. By default, it is TruckType.straight. Renderingsdk.mapview.TruckProfile
: TruckSpecifications.truckType is ignored and has no effect.isTruckLight
A flag indicating whether the truck is light enough to be classified more as a car than a truck in Japan. The flag should not be set to true in other countries than Japan. The flag defaults to false. - TruckSpecifications.withDefaults()
- Creates a new instance.
Properties
- axleCount ↔ int?
-
Defines total number of axles in the vehicle. The provided value must be greater than or
equal to 2. By default, it is not set.
Route calculation: When not set, possible axle count restrictions will not be
taken into consideration.
Rendering
sdk.mapview.TruckProfile
: When set, truck restriction icons for an axle count greater than TruckSpecifications.axleCount will not be displayed. When specifying TruckSpecifications.trailerAxleCount, then TruckSpecifications.axleCount is required and must be greater than TruckSpecifications.trailerAxleCount.getter/setter pair - grossWeightInKilograms ↔ int?
-
Truck weight including trailers and shipped goods in kilograms. The provided value
must be greater than or equal to 0. By default, it is not set.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setter
- heightInCentimeters ↔ int?
-
Truck height in centimeters. The provided value must be in the range [0, 5000].
By default, it is not set.
getter/setter pair
- isTruckLight ↔ bool
-
A flag indicating whether the truck is light enough to be classified more as a car than a truck in Japan.
The flag should not be set to true in other countries than Japan. The flag defaults to false.
getter/setter pair
- lengthInCentimeters ↔ int?
-
Truck length in centimeters. The provided value must be in the range [0, 30000].
By default, it is not set.
getter/setter pair
- payloadCapacityInKilograms ↔ int?
-
Allowed payload capacity, including trailers, specified in kilograms. The provided value
must be greater then or equal to 0. By default, it is not set.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trailerAxleCount ↔ int?
-
Defines total number of axles across all the trailers attached to the vehicle.
This number is included in TruckSpecifications.axleCount, hence TruckSpecifications.trailerAxleCount must be less than TruckSpecifications.axleCount
and greater than or equal to 1. TruckSpecifications.axleCount and TruckSpecifications.trailerCount are required to specify TruckSpecifications.trailerAxleCount.
By default, it is not set.
Note: This parameter is currently used only for the calculation of tolls in regions where it is applicable.
getter/setter pair
- trailerCount ↔ int?
-
Defines number of trailers attached to the vehicle. The provided value must be in the range
[0, 255]. By default, it is not set.
When specifying TruckSpecifications.trailerAxleCount, then TruckSpecifications.trailerCount is required and must be greater than 0.
getter/setter pair
- truckType ↔ TruckType
-
Defines the type of truck. By default, it is TruckType.straight.
Rendering
sdk.mapview.TruckProfile
: TruckSpecifications.truckType is ignored and has no effect.getter/setter pair - weightPerAxleGroup ↔ WeightPerAxleGroup?
-
Allows specification of axle weights in a more fine-grained way than
weight_per_axle_in_kilograms
. This is relevant in countries with signs and regulations that specify different limits for different axle groups, like the USA and Sweden. By default is not set. Note:weight_per_axle_in_kilograms
andweight_per_axle_group
are incompatible. When available for your edition, if both attributes are set, during online RoutingEngine ansdk.routing.RoutingError.INVALID_PARAMETER
error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.getter/setter pair - weightPerAxleInKilograms ↔ int?
-
Heaviest weight per axle, regardless of axle type or axle group.
It is evaluated against all axle weight restrictions, including single axle and tandem axle weight restrictions.
The provided value must be greater or equal to 0.
By default, it is not set.
Note:
weight_per_axle_in_kilograms
andweight_per_axle_group
are incompatible. When available for your edition, if both attributes are set, during online RoutingEngine ansdk.routing.RoutingError.INVALID_PARAMETER
error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.getter/setter pair - widthInCentimeters ↔ int?
-
Truck width in centimeters. The provided value must be in the range [0, 5000].
By default, it is not set.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool - The equality operator.