Greetings,
I am trying to use the directions widget in JSAPI 4.7 with our own route service, but when doing this the widget won't load. I realize that this widget is still in beta, but I am wondering if I am missing something in the configuration setup or maybe my ArcGIS Server, needs to be a certain version for this to work. Here is the simple code I am using:
var dirWidget = new Directions({
view: view,
routeServiceUrl: "https://<<link to working route service>>",
container: "directionsDiv"
});
The result is:
Thanks very much for any feedback!
Regard,
Tom
Solved! Go to Solution.
Tom Sellsted , testing your route service in the basic API sample, the console error message is
Directions.js:10 Uncaught TypeError: Cannot read property 'name' of null
at Object.b._renderTravelModeOptions (VM223 Directions.js:10)
at Object.b._renderReadyContent (VM223 Directions.js:9)
at Object.b._renderPanelContent (VM223 Directions.js:9)
at Object.b.render (VM223 Directions.js:8)
at q (dojo.js:2073)
If you look at the network traffic, you'll see there's a request for TravelModes that doesn't return any Travel Modes:
https://gis.yakimawa.gov/arcgis101/rest/services/Streets/StreetsNetwork/NAServer/Route/retrieveTrave...
The widget should (a) handle this better, but (b) in the meantime you might look to something like http://desktop.arcgis.com/en/arcmap/10.5/extensions/network-analyst/travel-modes-steps.htm
It should just work. Does it work with other versions?
tsellste If you don't want to share your routeserver URL here, you might want to contact Esri Support for specific help.
Bjorn,
It definitely works on 3.X versions. I am trying to port a public safety app that uses the directions dijit into 4.x and this is as far as I have gotten. The service URL is: Route (NAServer)
Thanks very much!
Regards,
Tom
Did you find anything out about this problem? I had provided my REST service. Thanks for any information you can offer!
Regards,
Tom
Tom Sellsted , testing your route service in the basic API sample, the console error message is
Directions.js:10 Uncaught TypeError: Cannot read property 'name' of null
at Object.b._renderTravelModeOptions (VM223 Directions.js:10)
at Object.b._renderReadyContent (VM223 Directions.js:9)
at Object.b._renderPanelContent (VM223 Directions.js:9)
at Object.b.render (VM223 Directions.js:8)
at q (dojo.js:2073)
If you look at the network traffic, you'll see there's a request for TravelModes that doesn't return any Travel Modes:
https://gis.yakimawa.gov/arcgis101/rest/services/Streets/StreetsNetwork/NAServer/Route/retrieveTrave...
The widget should (a) handle this better, but (b) in the meantime you might look to something like http://desktop.arcgis.com/en/arcmap/10.5/extensions/network-analyst/travel-modes-steps.htm
Bjorn,
Thanks very much! I will look into adding a travel mode to my network.
Regards,
Tom
Bjorn,
I did add a travel mode and the widget is function properly now. Thanks very much!
Regards,
Tom
This issue has been addressed and should no longer be an issue in our next 4.8 release.
Thanks for letting us know.
Thank you Heather!