Cannot load route service.

194
5
Jump to solution
2 weeks ago
AnthonyDAlessio
New Contributor II

I seem to be unable to use the RouteLayer/Directions to add the Directions widget to an existing project.  

Even the example https://developers.arcgis.com/javascript/latest/sample-code/widgets-directions/ here doesn't work, I get the same message "Cannot load route service. This may be due to the service not being accessible."

Looking at the service status no outages reported with this service.

Using this example to add Directions widget to my project.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html

 

 

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

As long as you have Routing and probably geocoding enabled for your key, should be fine.

ReneRubalcava_0-1714756894159.png

 

View solution in original post

5 Replies
ReneRubalcava
Frequent Contributor

The sample works in the sandbox.

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-directions

Are you opening the codepen link? If so, the Route service requires an API Key, so you need to provide a key in your own app.

AnthonyDAlessio
New Contributor II

Odd, I could have sworn I was, but I was using the "View Live" button, not sandbox.  Thanks lol it's been a long day...

0 Kudos
AnthonyDAlessio
New Contributor II

Ok, I copied the code from the sandbox and added my API key but I'm seeing the same error  (attached)

Is there something I need to turn on for my account to be able to use the route service?

0 Kudos
ReneRubalcava
Frequent Contributor

As long as you have Routing and probably geocoding enabled for your key, should be fine.

ReneRubalcava_0-1714756894159.png

 

AnthonyDAlessio
New Contributor II

That was it.  I did not realize that these were not enabled by default, had to go in and turn them on for that API key.