Leaflet Routing - ORS V2 Updates

Hi all,

I am a junior developer, having recently graduated from a coding bootcamp, and used Openrouteservice, Leaflet, and GraphHopper in the final project.

Website - https://thereandback.surge.sh/
GitHub - https://github.com/AndrewHulme/route_planner

Due the the recent Openrouteservice API upgrade to V2 the routing/directions are not working any more.

I have uploaded an screenshot example of how we use Openrouteservice for the router - L.Routing.openrouteservice.. on line 59.

Can anyone help? What is the easiest way to get our website working again?

As I mentioned we are all relatively new to coding.

Any help would be greatly appreciated!

Thank you :slight_smile:

Hi @AndrewHulme,

Please take a look at our api documentation and generate a JS example code to understand how you can request the v2/directions endpoints in JavaScript:

You could also use the get request but would not have additional options then.

A short search also got me this: https://github.com/willmorejg/lrm-openrouteservice/pull/6
guess that’s what you need

Hi @amandus,

Thank you so much, that pull request link at the bottom was just what we needed.

Hope you have a good evening.