VehicleSpec Object

Note

Bing Maps Web Control SDK retirement

Bing Maps Web Control SDK is deprecated and will be retired. Free (Basic) account customers can continue to use Bing Maps Web Control SDK until June 30th, 2025. Enterprise account customers can continue to use Bing Maps Web Control SDK until June 30th, 2028. To avoid service disruptions, all implementations using Bing Maps Web Control SDK will need to be updated to use Azure Maps Web SDK by the retirement date that applies to your Bing Maps for Enterprise account type. For detailed migration guidance, see Migrate from Bing Maps Web Control SDK and Migrate Bing Maps Enterprise applications to Azure Maps with GitHub Copilot.

Azure Maps is Microsoft's next-generation maps and geospatial services for developers. Azure Maps has many of the same features as Bing Maps for Enterprise, and more. To get started with Azure Maps, create a free Azure subscription and an Azure Maps account. For more information about azure Maps, see Azure Maps Documentation. For migration guidance, see Bing Maps Migration Overview.

Specifies the vehicle attributes to use when calculating a truck route.

Name Type Description
dimensionUnit string The unit of measurement of width, height, length. Can be one of the following values:

- meter or m [default]
- foot or ft
weightUnit string The unit of measurement of weight. Can be one of the following values.

- kilogram or kg [default]
- pound or lb
vehicleHeight number The height of the vehicle in the specified dimension units.
vehicleWidth number The width of the vehicle in the specified dimension units.
vehicleLength number The length of the vehicle in the specified dimension units.
vehicleWeight number The weight of the vehicle in the specified weight units.
vehicleAxles number The number of axles.
vehicleTrailers number The number of trailers.
vehicleSemi boolean Indicates if the truck is pulling a semi-trailer. Semi-trailer restrictions are mostly used in North America.
vehicleMaxGradient boolean The maximum gradient the vehicle can drive measured in degrees.
vehicleMinTurnRadius number The minimum required radius for the vehicle to turn in the specified dimension units.
vehicleAvoidCrossWind boolean Indicates if the vehicle shall avoid crosswinds.
vehicleAvoidGroundingRisk boolean Indicates if the route shall avoid the risk of grounding.
vehicleHazardousMaterials string A comma separated and case-sensitive list of one or more hazardous materials for which the vehicle is transporting. Possible values and their aliases are:

- Combustable or C
- Corrosive or Cr
- Explosive or E
- Flammable or F
- FlammableSolid or FS
- Gas or G
- GoodsHarmfulToWater or WH
- Organic or O
- Other
- Poison or P
- PoisonousInhalation or PI
- Radioactive or R
- None

Example: "WH,R,Poison"
vehicleHazardousPermits string A comma separated and case-sensitive list of one or more hazardous materials for which the vehicle has a permit. Possible values and their aliases are:
- AllAppropriateForLoad
- Combustible or C
- Corrosive or Cr
- Explosive or E
- Flammable or F
- FlammableSolid or FS
- Gas or G
- Organic or O
- Poison or **P **
- PoisonousInhalation or PI
- Radioactive or R
- None


Example: "C,Explosive,Corrosive"

Example

The following is an example how to specify a vehicle specification as part of a truck route request.

directionsManager.setRequestOptions({
	routeMode: Microsoft.Maps.Directions.RouteMode.truck,
	vehicleSpec: {
		dimensionUnit: 'ft',
		weightUnit: 'lb',
		vehicleHeight: 5,
		vehicleWidth: 3.5,
		vehicleLength: 30,
		vehicleWeight: 30000,
		vehicleAxles: 3,
		vehicleTrailers: 2,
		vehicleSemi: true,
		vehicleMaxGradient: 10,
		vehicleMinTurnRadius: 15,
		vehicleAvoidCrossWind: true,
		vehicleAvoidGroundingRisk: true,
		vehicleHazardousMaterials: 'F',
		vehicleHazardousPermits: 'F'
	}
});

See Also: