perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.06k stars 347 forks source link

Unable to change routing options #617

Open bilskip opened 3 years ago

bilskip commented 3 years ago

I don't know if it's an issue at all, but I have a very fiddling problem with setting routing options, and I can't find it anywhere and even in any example.

I wanted to change routing options for my router, I mean options in URL request. For default, there is:

overview=false&alternatives=true&steps=true&hints=;

And I can't set my own options. I even tried to change this part of code in leaflet-routing-machine.js:

    options: {
        serviceUrl: 'http://localhost:5000/trip/v1',
        profile: 'driving',
        timeout: 30 * 1000,
        routingOptions: {
            steps: true,
        },
        polylinePrecision: 5,
        useHints: true,
        suppressDemoServerWarning: false,
        language: 'en'
    },`

But changing anything do nothing. There is still "alternatives=true" in my url request. As you can see I wanted to change it for OSRM trip service - and this service can't have "alternatives" option. I must admit I'm a little bit beginner, so sorry for your time, and thanks for all help!