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. |
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 | {String} Indicates the hazardous material type; can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7). |
tunnelCategory | {Number} Indicates the tunnel categories which are 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. |
type | {String} Comma delimited string of report types. Depending on permissions type value can be Mileage, Directions, Detail, State, CalcMiles, LeastCost, or Geotunnel. Example: “Directions,Mileage” |
format | {String} Return format for the report. Valid formats are “json” or “html”. |
dataVersion | {String} Data version value can be Current, PCM_EU, PCM_OC, PCM_SA, PCM_GT, PCM_AF, PCM_AS, PCM_ME, or PCM18 through PCM27 |
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);
}
});