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.
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("url_goes_here");
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?
Christopher,
When you try to browse to the layer you linked I get
I noticed that. However, is something supposed to be listed?
I am also not sure what URL to use.
Christopher,
You are right.
This example works with the same route layer you provided above.