I have a pre-existing, custom routing services that has been used successfully with the JSAPI 3.x for a couple of years. We are in the process of updating to JSAPI 4.x and have run into a behavior issue where the built-in Directions widget is passing parameters to the `route` endpoint that are causing an error to be returned.
Specifically, the 3.x API includes
"simplificationTolerance":null,
"simplificationToleranceUnits":"esriUnknownUnits"
with the travelMode argument which the 4.x API does not. These parameters do not appear to be exposed in the RouteParameters object, which required more .... invasive ... methods to override.
Without these travelMode parameters set, we get the following error response the the "solve" endpoint
{
"error": {
"code":400,
"message":"Invalid or missing input parameters.",
"details":["The following travel mode is invalid: ..."]
}
}
Any recommendations on how to finess/configure the Direction widget to work around this issue; or perhaps even change how the Network Analyst service is published to make it friendlier to the JSAPI 4.x conventions?
Version Details
* ArcGIS Server 10.5.1
* Network Analyst Extension 10.5.1