perliedman / lrm-graphhopper

Support for GraphHopper in Leaflet Routing Machine
ISC License
31 stars 52 forks source link

Hi, help with service url parameters #8

Closed DanielShinken closed 8 years ago

DanielShinken commented 8 years ago

Hi there, I would like to know if there's a way to send parameters such as locale, optimize, etc through this plugin, I'm using it like this.

router: L.Routing.graphHopper(''),

but I would like to change the instruction's language and add more parameters, how can we achieve that?, thanks and greetings

perliedman commented 8 years ago

Hi!

There is an option for the L.Routing.GraphHopper class called urlParameters: it is a hash of parameters that will be added to the URL of each request to the server. You can use it like this, for example:

new L.Routing.GraphHopper('myKey', {urlParameters: {vehicle: 'foot'}})

Hope this helps!

DanielShinken commented 8 years ago

awesome! thank! awesome plugin!