AnsweredAssumed Answered

routetask_closest_facility sample code doesn't work

Question asked by autokad on Mar 10, 2016
Latest reply on Mar 11, 2016 by rscheitlin

I'm working with the javascript api and trying to recreate the sample code for route task / closest facility : Find closest facilities | ArcGIS API for JavaScript

It seems to work on your site, but when I copy the code and run it on my side it doesnt work.  When I double click on the file I get: Failed to load resource: net::ERR_FILE_NOT_FOUND error Error(…)

When I run it from a web service such as this:

Closest Facilities

I get:

GET…ts%22%3Atrue%7D& 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

init.js:1672 error Error(…)


Whats wrong with the sample code?