<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Directions Widget (4.x) triggered custom service error; 3.x Working in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1131736#M75846</link>
    <description>&lt;P&gt;I have a pre-existing, custom routing services that has been used successfully with the JSAPI 3.x for a couple of years.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;Specifically, the 3.x API includes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"simplificationTolerance":null,
"simplificationToleranceUnits":"esriUnknownUnits"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the travelMode argument which the 4.x API does not.&amp;nbsp; These parameters do not appear to be exposed in the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RouteParameters.html" target="_blank" rel="noopener"&gt;RouteParameters&lt;/A&gt;&amp;nbsp;object, which required more .... invasive ... methods to override.&lt;BR /&gt;&lt;BR /&gt;Without these travelMode parameters set, we get the following error response the the "solve" endpoint&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "error": {
    "code":400,
    "message":"Invalid or missing input parameters.",
    "details":["The following travel mode is invalid: ..."]
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Version Details&lt;/STRONG&gt;&lt;BR /&gt;* ArcGIS Server 10.5.1&lt;BR /&gt;* Network Analyst Extension 10.5.1&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jan 2022 21:42:58 GMT</pubDate>
    <dc:creator>LucasScharenbroich</dc:creator>
    <dc:date>2022-01-07T21:42:58Z</dc:date>
    <item>
      <title>Directions Widget (4.x) triggered custom service error; 3.x Working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1131736#M75846</link>
      <description>&lt;P&gt;I have a pre-existing, custom routing services that has been used successfully with the JSAPI 3.x for a couple of years.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;Specifically, the 3.x API includes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"simplificationTolerance":null,
"simplificationToleranceUnits":"esriUnknownUnits"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the travelMode argument which the 4.x API does not.&amp;nbsp; These parameters do not appear to be exposed in the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RouteParameters.html" target="_blank" rel="noopener"&gt;RouteParameters&lt;/A&gt;&amp;nbsp;object, which required more .... invasive ... methods to override.&lt;BR /&gt;&lt;BR /&gt;Without these travelMode parameters set, we get the following error response the the "solve" endpoint&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "error": {
    "code":400,
    "message":"Invalid or missing input parameters.",
    "details":["The following travel mode is invalid: ..."]
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Version Details&lt;/STRONG&gt;&lt;BR /&gt;* ArcGIS Server 10.5.1&lt;BR /&gt;* Network Analyst Extension 10.5.1&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 21:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1131736#M75846</guid>
      <dc:creator>LucasScharenbroich</dc:creator>
      <dc:date>2022-01-07T21:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Directions Widget (4.x) triggered custom service error; 3.x Working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1132029#M75854</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9830"&gt;@LucasScharenbroich&lt;/a&gt;,&amp;nbsp;I haven't encountered this scenario before. Would it be possible for you to share the routing service endpoint so I could do some testing? You could also message me directly if you don't want to share it on this post (if it's publicly accessible). Does it also use a custom locator?&lt;/P&gt;&lt;P&gt;It also may be possible that the 3x app overrides the travelMode, making it valid. If that's the case, you should be able to set the current travelMode using this property on the DirectionsViewModel:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 18:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1132029#M75854</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-01-10T18:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Directions Widget (4.x) triggered custom service error; 3.x Working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1147035#M76450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9830"&gt;@LucasScharenbroich&lt;/a&gt;,&amp;nbsp;looks like we'll have this fixed in the next release (4.23), which is expected in late March.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/directions-widget-4-x-triggered-custom-service/m-p/1147035#M76450</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-02-23T16:31:16Z</dc:date>
    </item>
  </channel>
</rss>

