<?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 Re: Get directions route info details of Directions Widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112272#M75116</link>
    <description>&lt;P&gt;Hi I have tried to sort it out, and have created somthing like below&lt;/P&gt;&lt;P&gt;directions.on("directions-finish", changeHandler);&lt;BR /&gt;&lt;BR /&gt;function changeHandler(data) {&lt;BR /&gt;if (data.routeResults.length &amp;gt; 0) {&lt;BR /&gt;const features = data.routeResults[0].directions.features;&lt;BR /&gt;features.forEach(function (result, i) {&lt;BR /&gt;console.log(result.attributes.text);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;But I have got a message error :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;TypeError: Cannot read properties of undefined (reading 'length')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 22:12:27 GMT</pubDate>
    <dc:creator>benchikh</dc:creator>
    <dc:date>2021-10-28T22:12:27Z</dc:date>
    <item>
      <title>Get directions route info details of Directions Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112048#M75100</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Im working with arcgis api 3.38 Directions Widget, I have declared the directions widget as below:&lt;/P&gt;&lt;P&gt;var directions = new Directions({&lt;BR /&gt;map: map,&lt;BR /&gt;showClearButton: true,&lt;BR /&gt;showSegmentPopup: false,&lt;BR /&gt;directionsLengthUnits: "esriMiles",&lt;BR /&gt;mapClickActive: true,&lt;BR /&gt;routeTaskUrl: "&lt;A href="https://xxxxxxxx/arcgis/rest/services/CALCUL_ITINERAIRE/NAServer/Route" target="_blank"&gt;https://xxxxxxxx/arcgis/rest/services/CALCUL_ITINERAIRE/NAServer/Route&lt;/A&gt;",&lt;BR /&gt;searchOptions: options&lt;BR /&gt;}, "dir");&lt;BR /&gt;directions.startup();&lt;/P&gt;&lt;P&gt;The question is, there is a way to recuperate the Directions route info Details (Start Point, Time,... Finish Point, time) as I want to send them to a web service URL&lt;/P&gt;&lt;P&gt;Many thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 12:03:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112048#M75100</guid>
      <dc:creator>benchikh</dc:creator>
      <dc:date>2021-10-28T12:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get directions route info details of Directions Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112078#M75105</link>
      <description>&lt;P&gt;You should be able to listen to the `directions-finish` event, which returns a RouteResult that you can then handle as you wish.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/directions-amd.html#event-directions-finish" target="_blank"&gt;https://developers.arcgis.com/javascript/3/jsapi/directions-amd.html#event-directions-finish&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 13:45:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112078#M75105</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2021-10-28T13:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get directions route info details of Directions Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112186#M75114</link>
      <description>&lt;P&gt;Many thanks for your reply, could please describe it with a sample of code as Im a beginner and dont have enough experience to handle it please .&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 17:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112186#M75114</guid>
      <dc:creator>benchikh</dc:creator>
      <dc:date>2021-10-28T17:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get directions route info details of Directions Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112272#M75116</link>
      <description>&lt;P&gt;Hi I have tried to sort it out, and have created somthing like below&lt;/P&gt;&lt;P&gt;directions.on("directions-finish", changeHandler);&lt;BR /&gt;&lt;BR /&gt;function changeHandler(data) {&lt;BR /&gt;if (data.routeResults.length &amp;gt; 0) {&lt;BR /&gt;const features = data.routeResults[0].directions.features;&lt;BR /&gt;features.forEach(function (result, i) {&lt;BR /&gt;console.log(result.attributes.text);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;But I have got a message error :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;TypeError: Cannot read properties of undefined (reading 'length')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 22:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112272#M75116</guid>
      <dc:creator>benchikh</dc:creator>
      <dc:date>2021-10-28T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get directions route info details of Directions Widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112344#M75121</link>
      <description>&lt;P&gt;I have solved the&amp;nbsp; issue as below, Many thanks for your support&lt;/P&gt;&lt;P&gt;directionsW.on("directions-finish", changeHandler);&lt;BR /&gt;&lt;BR /&gt;function changeHandler(data) {&lt;BR /&gt;console.log("done", data.result);&lt;BR /&gt;if (data.result.routeResults.length &amp;gt; 0) {&lt;BR /&gt;const features = data.result.routeResults[0].stops;&lt;BR /&gt;features.forEach(function (result, i) {&lt;BR /&gt;console.log(result.attributes.Name );&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 07:59:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-directions-route-info-details-of-directions/m-p/1112344#M75121</guid>
      <dc:creator>benchikh</dc:creator>
      <dc:date>2021-10-29T07:59:20Z</dc:date>
    </item>
  </channel>
</rss>

