Truck
public class Truck : Vehicle, Motorized, CargoCapable
A vehicle of type truck.
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(maxSpeed:
isCommercial: combustionEngine: electricEngine: dimensions: loadType: adrTunnelRestrictionCode: modelID: ) Declaration
Swift
public init( maxSpeed: Measurement<UnitSpeed>? = nil, isCommercial: Bool = true, combustionEngine: CombustionEngine? = nil, electricEngine: ElectricEngine? = nil, dimensions: VehicleDimensions? = nil, loadType: Set<VehicleLoadType> = [], adrTunnelRestrictionCode: ADRTunnelRestrictionCode? = nil, modelID: String? = nil )
Parameters
maxSpeed
Specifies max truck speed.
isCommercial
If true, the vehicle is used for commercial purposes and thus may not be allowed to drive on some roads.
combustionEngine
The vehicle’s combustion engine for route and consumption calculation.
electricEngine
The vehicle’s electric engine for route and consumption calculation.
dimensions
The vehicle’s dimensions for route calculation.
loadType
The hazardous materials class of the vehicle’s load.
adrTunnelRestrictionCode
The ADR tunnel restrictions of the vehicle.
modelID
Specifies the Model ID of the vehicle as obtained from the TomTom Vehicle Database. It allows calculating an EV route without specifying the vehicle’s consumption and charging parameters.
-
If true, the vehicle is used for commercial purposes and thus may not be allowed to drive on some roads.
Declaration
Swift
public let isCommercial: Bool
-
The vehicle’s combustion engine for route and consumption calculation.
Declaration
Swift
public let combustionEngine: CombustionEngine?
-
The vehicle’s electric engine for route and consumption calculation.
Declaration
Swift
public let electricEngine: ElectricEngine?
-
The vehicle’s dimensions for route calculation.
Declaration
Swift
public let dimensions: VehicleDimensions?
-
The hazardous materials class of the vehicle’s load.
Declaration
Swift
public let loadType: Set<VehicleLoadType>
-
The ADR tunnel restrictions of the vehicle.
Declaration
Swift
public let adrTunnelRestrictionCode: ADRTunnelRestrictionCode?
-
Specifies the Model ID of the vehicle as obtained from the TomTom Vehicle Database. It allows calculating an EV route without specifying the vehicle’s consumption and charging parameters.
Declaration
Swift
public let modelID: String?
-
Copies the current Truck with changes specified in build closure
Declaration
Swift
public func copy(build: (inout Builder) -> ()) -> Truck
Parameters
build
This closure allows for change of Truck values
Return Value
Truck with the changes set on the closure
-
The
Builder
creates a new instance ofTruck
with modified fields.Declaration
Swift
public struct Builder