<?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: Calculate several routes' totalTime using 'solve' function in RouteTask in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/calculate-several-routes-totaltime-using-solve/m-p/57472#M5061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got a solution. We can specify the 'RouteParameters.returnStops' as true, so there will be the stops of current route in each routeResult .Just like this.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/187897_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;In this way, we can know which route the time represents for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Feb 2016 12:54:56 GMT</pubDate>
    <dc:creator>LinQing</dc:creator>
    <dc:date>2016-02-26T12:54:56Z</dc:date>
    <item>
      <title>Calculate several routes' totalTime using 'solve' function in RouteTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/calculate-several-routes-totaltime-using-solve/m-p/57471#M5060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I am trying to get the travel time of several routes using the methods and functions in 'RouteTask' but I met a problem. Here are my codes.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function Judge(){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var combination=get_Combination();&amp;nbsp; //get_Combination() is a function that can return the different combinations of stops
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var h=0;h&amp;lt;combination.length;h++){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clearStops(); // clear the stops set
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add(combination&lt;H&gt;);&amp;nbsp; // add the stop combinations in array into the stops set&lt;/H&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; solve_Route();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the solve_Route() function is,&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function solve_Route() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; routeTask.solve(routeParams).then(function(results){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(results.routeResults[0].directions.totalTime);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My testing data has 3 stops and there are 4 combinations in total. Except the combination that only has one stop.&lt;/P&gt;&lt;P&gt;The problem is the order of travel time is different every time as follow. It seems like the order is random.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/187370_pastedImage_26.png" style="max-width: 1200px; max-height: 900px;" /&gt; &lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/187371_pastedImage_27.png" style="max-width: 1200px; max-height: 900px;" /&gt; &lt;/P&gt;&lt;P&gt;I don't know what the order depends on. That's to say I don't know each time corresponds to which route. And I need to know this cause I still need to use the time do some judgement. So any suggestions I will be so appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:10:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/calculate-several-routes-totaltime-using-solve/m-p/57471#M5060</guid>
      <dc:creator>LinQing</dc:creator>
      <dc:date>2021-12-10T22:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate several routes' totalTime using 'solve' function in RouteTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/calculate-several-routes-totaltime-using-solve/m-p/57472#M5061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got a solution. We can specify the 'RouteParameters.returnStops' as true, so there will be the stops of current route in each routeResult .Just like this.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/187897_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;In this way, we can know which route the time represents for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 12:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/calculate-several-routes-totaltime-using-solve/m-p/57472#M5061</guid>
      <dc:creator>LinQing</dc:creator>
      <dc:date>2016-02-26T12:54:56Z</dc:date>
    </item>
  </channel>
</rss>

