openstreetmap-website icon indicating copy to clipboard operation
openstreetmap-website copied to clipboard

Link directions to routing engine demo

Open 1ec5 opened this issue 4 months ago • 3 comments

GraphHopper, OSRM, and Valhalla all have their own first-party demo page that exposes more options and details than the Leaflet Routing Machine plugin we’re using, such as via points (A to B to C), turn lanes, elevation profiles, time-sensitive routing, truck routing, and isochrones. Some of these features would be useful to mappers using the OSM website, but others are mainly useful to end users. The end user experience for directions is much more open-ended. We could address their needs by linking out to the selected routing engine’s demo page, adding any supported parameters that can get the page to show something equivalent to the current directions. Then it’s up to the routing engine projects whether they want to facilitate the end user experience to that degree. For example, the GraphHopper and OSRM demo pages both have a convenient button to export GPX (#5224), so there’s less need for us to reimplement that functionality ourselves.

1ec5 avatar Sep 08 '25 17:09 1ec5

@team can you please assign this task to me?

maishivamhoo123 avatar Sep 09 '25 18:09 maishivamhoo123

https://github.com/openstreetmap/openstreetmap-website/blob/master/CONTRIBUTING.md#finding-issues-to-work-on

tomhughes avatar Sep 09 '25 18:09 tomhughes

I have pointed you at that twice before in #6282 and #6311 so please do read it - we don't use assignment in this repository.

tomhughes avatar Sep 09 '25 18:09 tomhughes

the Leaflet Routing Machine plugin we’re using

My bad, we aren’t use the Leaflet Routing Machine: #1262. Instead we have our own homegrown abstraction with adapters for GraphHopper, OSRM, and Valhalla. Each adapter currently hard-codes a link to the routing provider as attribution:

https://github.com/openstreetmap/openstreetmap-website/blob/db8748265138f6a1375ff565b71589e8497b50c6/app/assets/javascripts/index/directions-route-output.js#L138-L140 https://github.com/openstreetmap/openstreetmap-website/blob/db8748265138f6a1375ff565b71589e8497b50c6/app/assets/javascripts/index/directions/graphhopper.js#L40 https://github.com/openstreetmap/openstreetmap-website/blob/db8748265138f6a1375ff565b71589e8497b50c6/app/assets/javascripts/index/directions/fossgis_valhalla.js#L61 https://github.com/openstreetmap/openstreetmap-website/blob/db8748265138f6a1375ff565b71589e8497b50c6/app/assets/javascripts/index/directions/fossgis_osrm.js#L155

We could supplement that link with a link to the full demo site. The code above already has access to all the parameters that we’d want to pass into the demo site. As far as I can tell, none of the demo sites document their URL parameters, so it’ll require some experimentation.

1ec5 avatar Dec 18 '25 20:12 1ec5

We could supplement that link with a link to the full demo site

https://github.com/openstreetmap/openstreetmap-website/issues/5224#issuecomment-2365144537 has all details already. Back then nobody wanted to implement it.

mmd-osm avatar Dec 18 '25 20:12 mmd-osm