AnsweredAssumed Answered

RoutingTask Error 9004$LAYER_NOT_EXIST

Question asked by jursachr_washco on Oct 30, 2015
Latest reply on Oct 30, 2015 by dafiter



I am attempting to solve a route.  My code is below.


To create my service, I added the following URL to my ArcGIS Online content.

I then made it accessible to everyone and used the REST URL in my code.




//prepare parameters
 var myRouteParams = new RouteParameters();
 myRouteParams.stops = new FeatureSet();
 myRouteParams.returnRoutes = true;
 myRouteParams.returnDirections = true;
 myRouteParams.outSpatialReference = new SpatialReference({ wkid:4326 });
 //perform route between addresses  
 var myRouteTask = new RouteTask("MY URL");       



However, I get the following error in the debugger. error Error: 9004$LAYER_NOT_EXIST

" error"

[object Error]{code: 500, description: "", details: Array[0], httpCode: 500, log: undefined, message: "9004$LAYER_...", name: "Error", number: 0}


What is causing this error?  Do I need something else in my routing parameters?