AnsweredAssumed Answered

Travel Mode Error in Direction Widget WAB

Question asked by ARROCAL on Dec 5, 2017
Latest reply on Dec 5, 2017 by rscheitlin

Hello;

 

I have developed a WAB application with the Direction widget. The route web service has 2 travel modes.

In the startupt function of the widget I set  the travel mode to one of them (not the default ) and initialize the Direction dijit:

….

….                                                              

var routeTask = new RouteTask(this.config.routeTaskUrl1);     

routeTask.getServiceDescription().then(lang.hitch(this, function (serviceInfo) {

                        

        travelModes=serviceInfo.supportedTravelModes;

        this._dijitDirections.routeParams.travelMode= travelModes[1];

                                                

}))

 this._dijitDirections = new Directions(options, directionContainer);

 this._dijitDirections.startup();

 

After the line:  this._dijitDirections.startup (); the property travelMode is correct because it has the value that I have previously assigned:  travelModes [1]. 

 

But when the calculation of the route starts, the travelMode property changes to the other travel mode (travelModes [0]) and the calculation is made with this other travel mode.

 

I can see it in the directionStart event with the debugging tools. 

 

Any suggestions about  how to make the calculation  with the travel mode that I configured at the start (this._dijitDirections.routeParams.travelMode = travelModes [1];).?

 

the combo always shows the travel mode that I do not want. 

 

Js api version 3.22 

 

Thank you very much.

 

Outcomes