Select to view content in your preferred language

Travel mode

5673
8
Jump to solution
06-07-2016 03:22 AM
GünterDörffel
Frequent Contributor

Can the Web AppBuilder Directions widget be configured to use the Travel modes that are part of the custom Network Dataset I use?

I try to activate the Travel Mode Selection - but cant ... the use of the global travel modes or the ones of my organisation is not what I need - there are travel modes defined in the Network dataset.

Any way to do this?

Regards
Guenter 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Günter,

Because you are using the minified code from an AGOL download it looks a lot different then the WAB Developer code. First make a backup of this Widget.js file (Just in case) and then search for this string:

this.config.travelModesUrl?(a.travelModesServiceUrl=this.config.travelModesUrl,a.doNotFetchTravelModesFromOwningSystem=!1):a.doNotFetchTravelModesFromOwningSystem=

!0;

and delete all of it.

Now you will not be able to re-host this app on AGOL after making any code modification like this you will have to host the app on your own web server (just in case you did not already know this).

View solution in original post

8 Replies
RobertScheitlin__GISP
MVP Emeritus

Günter,

  Have you set the "Travel Modes URL" in the Directions widget Settings dialog?

0 Kudos
GünterDörffel
Frequent Contributor

Hey Robert,

I tried! Thats excactly the question: What would that travel mode URL be given that my published Network Service has it’s own travel modes . When I use the JAVASCRIPT-Widget on my Network Service, the available Travel-Modes are immediately displayed: See here: http://www.esri-austria.at/schaumal/directions_gip.html (this is a ND based on OpenGouvernmentData in Austria)

Its those travel modes I’d like to see in the widget, too. No clue what the URL will have to look like or what to do on my server to enable it. And the one that Esri has I there as an example a) is not accessible and b)wouldn’t show my own travel modes anyway

Do you have any idea?

Have you been successful with a network dataset of your own – so not the Esri default one?

Thanks and regards

Guenter

Von: Robert Scheitlin, GISP

Gesendet: Donnerstag, 9. Juni 2016 15:11

An: Dörffel Günter <g.doerffel@mysynergis.com>

Betreff: Re: - Travel mode

GeoNet <https://community.esri.com/?et=watches.email.thread>

Travel mode

reply from Robert Scheitlin, GISP<https://community.esri.com/people/rscheitlin?et=watches.email.thread> in Web AppBuilder for ArcGIS - View the full discussion<https://community.esri.com/message/614130?et=watches.email.thread#comment-614130>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Günter,

  I found the solution to this.

  Open the Widget.js in your apps directions widget folder and comment out lines 158 - 163. The the widget will automatically use your route services travel modes.

0 Kudos
GünterDörffel
Frequent Contributor

Hi Robert,

that sounds good – but I had to download the App – was hosted on AGOL … and there the file to edit looks as if those couldnt be the lines you mentioned … find attached … different version? I do not have a proper JS-editing environment here …

Regards

Guenter

Von: Robert Scheitlin, GISP

Gesendet: Donnerstag, 9. Juni 2016 16:01

An: Dörffel Günter <g.doerffel@mysynergis.com>

Betreff: Re: - Travel mode

GeoNet <https://community.esri.com/?et=watches.email.thread>

Travel mode

reply from Robert Scheitlin, GISP<https://community.esri.com/people/rscheitlin?et=watches.email.thread> in Web AppBuilder for ArcGIS - View the full discussion<https://community.esri.com/message/614138?et=watches.email.thread#comment-614138>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Günter,

Because you are using the minified code from an AGOL download it looks a lot different then the WAB Developer code. First make a backup of this Widget.js file (Just in case) and then search for this string:

this.config.travelModesUrl?(a.travelModesServiceUrl=this.config.travelModesUrl,a.doNotFetchTravelModesFromOwningSystem=!1):a.doNotFetchTravelModesFromOwningSystem=

!0;

and delete all of it.

Now you will not be able to re-host this app on AGOL after making any code modification like this you will have to host the app on your own web server (just in case you did not already know this).

GünterDörffel
Frequent Contributor

Thanks Robert,

this works fine! Yes – I knew I’d have to host it locally now …

Regards

Guenter

Von: Robert Scheitlin, GISP

Gesendet: Donnerstag, 9. Juni 2016 17:11

An: Dörffel Günter <g.doerffel@mysynergis.com>

Betreff: Re: - Travel mode

GeoNet <https://community.esri.com/?et=watches.email.thread>

Travel mode

reply from Robert Scheitlin, GISP<https://community.esri.com/people/rscheitlin?et=watches.email.thread> in Web AppBuilder for ArcGIS - View the full discussion<https://community.esri.com/message/614077?et=watches.email.thread#comment-614077>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Günter,

Glad to help. Don't forget to mark this thread as answered by click on the "Correct Answer" link on the reply that answered your question.

0 Kudos
samanthasam
New Contributor

Unfortunately, Web AppBuilder's Directions widget doesn't support custom travel modes from a Network Dataset directly. You might need to use a custom widget or consider other development options to achieve this.

0 Kudos