Hi, I am trying to programatically set/use the default travel mode of "TravelTime" in a RouteTask.
// Setup the route parameters
var routeParams = new RouteParameters({
returnDirections: true,
stops: new FeatureSet({
features: view.graphics.toArray()
}),
travelMode: ?????? //How do I set this to a default TravelMode of "Travel Time", or "Drive Time", or "Truck"?
});
// Get the route
routeTask.solve(routeParams).then(function(data) {
//Do Stuff Here......
});
Is it possible to use the default travel modes that arcGIS has for shortest time, shortest distance, and truck routing?
I think this is the documentation you are looking for:
RouteParameters | ArcGIS API for JavaScript 4.16
Note that a valid travelMode property is will be dependent on the Network Analyst server to which the request is sent.