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

Hello,

 

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.

http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World

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.stops.features.push(myStartingGraphic);
 myRouteParams.stops.features.push(myEndingGraphic);
 myRouteParams.returnRoutes = true;
 myRouteParams.returnDirections = true;
 myRouteParams.outSpatialReference = new SpatialReference({ wkid:4326 });
      
 //perform route between addresses  
 var myRouteTask = new RouteTask("MY URL");       
 myRouteTask.solve(myRouteParams); 

 

 

However, I get the following error in the debugger.

 

dojo.io.script error Error: 9004$LAYER_NOT_EXIST

"dojo.io.script 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?

Outcomes