<?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: routetask_closest_facility sample code doesn't work in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routetask-closest-facility-sample-code-doesn-t/m-p/249899#M23161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sample is setup to use a proxy to provide the credentials for the routing task (the routing service consumes credits and thus you have to have a proxy configured if you do not want the user challenged for AGOL credentials). You will see in the code that the sample is looking for the proxy to be in the web pages sproxy folder and your copy does not have this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; uaddProxyRule({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlPrefix: "route.arcgis.com", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proxyUrl: "/sproxy/"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You either have to comment out the above section in your code and then it will prompt the user to login to your org or AGOL or you need to setup and configure a proxy for your page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:25:26 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-11T12:25:26Z</dc:date>
    <item>
      <title>routetask_closest_facility sample code doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routetask-closest-facility-sample-code-doesn-t/m-p/249898#M23160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I'm working with the javascript api and trying to recreate the sample code for route task / closest facility : &lt;A href="https://developers.arcgis.com/javascript/jssamples/routetask_closest_facility.html" title="https://developers.arcgis.com/javascript/jssamples/routetask_closest_facility.html"&gt;Find closest facilities | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;It seems to work on your site, but when I copy the code and run it on my side it doesnt work.&amp;nbsp; When I double click on the file I get: Failed to load resource: net::ERR_FILE_NOT_FOUND dojo.io.script error Error(…)&lt;/P&gt;&lt;P&gt;When I run it from a web service such as this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://musa505.com/spring16/routetask_closest_facility.html" title="http://musa505.com/spring16/routetask_closest_facility.html"&gt;Closest Facilities&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;GET &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmusa505.com%2Fsproxy%2F%3Fhttps%3A%2F%2Froute.arcgis.com%2Farcgis%2Frest%2Fservices%2FWo%E2%80%A6ts%2522%253Atrue%257D%26callback%3Ddojo.io.script.jsonp_dojoIoScript1._jsonpCallback" rel="nofollow" target="_blank"&gt;http://musa505.com/sproxy/?https://route.arcgis.com/arcgis/rest/services/Wo…ts%22%3Atrue%7D&amp;amp;callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback&lt;/A&gt;&lt;SPAN&gt; 404 (Not Found)g._attach @ init.js:1241g @ init.js:1239a.get @ init.js:1669v @ init.js:1045d @ init.js:1049x @ init.js:1055a.solve @ ClosestFacilityTask.js:5v.addCallbacks.g @ init.js:824c @ init.js:66A.then.then @ init.js:68addCallbacks @ init.js:68c.(anonymous function) @ init.js:824mapClickHandler @ routetask_closest_facility.html:187(anonymous function) @ init.js:1353g.(anonymous function).h @ init.js:234m._fire @ init.js:956m._fireClickEvent @ init.js:962(anonymous function) @ init.js:167setTimeout (async)m._onClickHandler @ init.js:961(anonymous function) @ init.js:167&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;init.js:1672 dojo.io.script error Error(…)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whats wrong with the sample code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 04:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routetask-closest-facility-sample-code-doesn-t/m-p/249898#M23160</guid>
      <dc:creator>karldailey</dc:creator>
      <dc:date>2016-03-11T04:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: routetask_closest_facility sample code doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routetask-closest-facility-sample-code-doesn-t/m-p/249899#M23161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sample is setup to use a proxy to provide the credentials for the routing task (the routing service consumes credits and thus you have to have a proxy configured if you do not want the user challenged for AGOL credentials). You will see in the code that the sample is looking for the proxy to be in the web pages sproxy folder and your copy does not have this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; uaddProxyRule({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlPrefix: "route.arcgis.com", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proxyUrl: "/sproxy/"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You either have to comment out the above section in your code and then it will prompt the user to login to your org or AGOL or you need to setup and configure a proxy for your page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:25:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routetask-closest-facility-sample-code-doesn-t/m-p/249899#M23161</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T12:25:26Z</dc:date>
    </item>
  </channel>
</rss>

