GraphHopper.com | Forum | GitHub | Maps | Blog

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


#1

Hi,

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


#2

You can provide these parameters per request:

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