region | {String} The data region in which pings are located. Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide. AF indicates Africa, AS indicates Asia, EU indicates Europe, NA indicates the North America, OC indicates Oceania, SA indicates South America. The default is NA. |
dataset | {String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA or Current (default) |
highwayOnly | {Boolean} To indicate whether to use highway only routing or not. The default is false. |
vehicleType | {String} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2). |
routingType | {String} The desired routing algorithm which can be Practical (0) or Shortest (1). |
classOverrides | {String} A comma-separated list of class overrides which can be None (0x0), NationalNetwork (0x1) and/or FiftyThreeFoot (0x2). Default is None. |
distanceUnits | {String} Distance units as Miles (0) or Kilometers (1). |
tollDiscourage | {Boolean} Indicates whether or not to avoid tolls while routing; can be true or false. Default is false. This parameter will be ignored if tollroads parameter is not null. |
bordersOpen | {Boolean} Indicates whether borders are open for travel; can be true or false. |
overrideRestrict | {Boolean} Indicates whether or not to override truck restrictions; can be true or false. Default is false. |
hazMatType | {Number|String} Indicates the hazardous material type; can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7), Tunnel (8). Single hazMatType has been deprecated. It is recommended to use hazMatTypes. |
tunnelCategory | {Number} Indicates the tunnel category which is applicable for EU region only. Values can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4). |
trkUnits | {String} Vehicle dimension units; can be English (0) or Metric (1). |
trkHeight | {Number} The height of the truck in feet and inches or meters depending on units. The default is 13’6” in all regions except Europe, which is 12’6”. Example 13’6” or 4.1148. |
trkLength | {Number} The length of the truck in feet and inches or meters depending on units. Default is 48 feet in all regions except Europe, which is 54’1”. Example 13’6” or 4.1148. |
trkWidth | {Number} The width of the truck in feet and inches or meters depending on units. This value can be 96” and below, 102” and above or 98”. The default value is 96” for all regions. Example 13’6” or 4.1148. |
trkWeight | {Number} The weight of the truck in pounds or kilograms depending on units. Acceptable values can be up to 132,000 pounds or 59,874 kilos. The default value is 80,000 pounds for all regions. |
trkAxles | {Number} The number of axles on the truck; acceptable values are 2 through 14 and the default value is 5. |
trkLCV | {Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle; can be true or false. |
routeOptimization | {String} Indicates the method by which to optimize route stops; can be None (0), ThruAll (1) or DestinationFixed (2). |
hubRouting | {Boolean} Indicates whether or not to enable hub routing; can be true or false. |
governorSpeedLimit | {Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value. Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}. |
avoidState | {Array<String>} A list of states are avoided, for example [‘NJ’, ‘PA’]. ISO2 code. |
avoidCountry | {Array<String>} A list of countries are avoided, for example [‘US’, ‘CA’]. ISO2 code. |
favorState | {Array<String>} A list of states are in favor. |
favorCountry | {Array<String>} A list of countries are in favor. |
tollroads | {Number} 1 - always avoid; 2 - avoid if possible; 3 - use toll road. Defaut is null. If it is null, tollDiscourage will be used. |
assetID | {String} Asset ID |
maitainHeading | {Boolean} When this option is set, a vehicle will attempt to avoid u-turns at intermediate stops and instead leave the stop in the same direction it entered it. |
hazMatTypes | {Array<Number>} Restricts the route to roads that allow transportation of the selected hazardous materials, such as [1, 2, 3]. |
tunnelCategories | {Array<Number>} Indicates the tunnel categories which are applicable for EU region only. |
routingLayer.addRoute({
stops: [L.latLng(40.40347,-74.64840),L.latLng(40.367494, -74.655522), L.latLng(39.822326,-75.191123)],
options: {
region: "NA",
dataset: "Current",
vehicleType: "Truck",
routingType: "Practical",
highwayOnly: false,
tollDiscourage: true
},
functionOptions: {
showHandles: false,
frameRoutes: true,
style: { opacity: 0.6, color: "#2448ff", weight: 20 }
},
reportOptions: {
"type": "Directions,Mileage,Detail,State",
"format": "html",
"dataVersion": "PCM_EU"
},
success: function(resp){
console.log(resp);
},
failure: function(resp){
var text = resp.responseText;
console.log(text);
}
});