How to change algorithms (ch.disable=true) in the JS graphhopper-client


Using GH’s JS client demo and Route Optimization API for discussion:

When instantiating a new GraphHopper.Routing object, how do you set ch.disable=true or the weighting? I want to enable turn restrictions and dynamically change the vehicle profile for a travelling salesman application I’m prototyping.

Thank you

You can provide these parameters per request:

ghRouting.doRequest({weighting:"fastest", ch: {disabled: true}}).
then(function(json) {
}).catch(function(err) {