AnsweredAssumed Answered

How to add the "overrides" property to RouteParameters?

Question asked by n.koehnesri-de-esridist Employee on May 31, 2017
Latest reply on Jun 14, 2017 by n.koehnesri-de-esridist

Hi all, hi Rene Rubalcava, hi Matt Crowder,

I'm using the Directions widget in JS API 3.x, and I'm setting some RouteParameters via


this.directions.on("directions-start", lang.hitch(this, function(evt) {
  this.directions.routeParams.impedanceAttribute = <...>;
  this.directions.routeParams.accumulateAttributes = <...>; 
  this.directions.routeParams.directionsTimeAttribute = <...>; 
}));

Those are working, I can see them being send in the GET request and they affect the results as expected.

 

Now here's the thing: There is a new parameter in the 10.5 NAServer REST interface called "overrides", which I need to set. This parameter doesn't exist on the JS object RouteParameters, and if I just add it to directions.routeParams, it won't go through to the request. (I've tried just assigning this.directions.routeParams.overrides, but I've also tried ES6's Object.assign in the Chrome dev console: The property is added to the routeParams object, but it's still not transferred to the request.)

Afaik, there is no later point for me to alter the request: The Directions widgets seems to implicitly call RouteTask.solve(routeParams), and there is no pre-solve event or anything on the RouteTask to intercept the call.

 

Btw, the same goes for the 4.x API - no "overrides" parameter on RouteParameters.

 

Testing via the plain REST API test form (NAServer/Route/solve), I can set the "overrides" parameter and it works.

 

Can someone help?
Thanks
Nik

Outcomes