0

I have OSRM (node-osrm) set up locally and it produces correct results for routes on the server. However, when I request routes from it via leaflet routing machine I get the following error in the browser:

leaflet-routing-machine.js:2605 Routing error: Object {status: undefined}status: undefined__proto__: ObjectdefaultErrorHandler 

@ leaflet-routing-machine.js:2605fire 
@ leaflet-src.js:588(anonymous function) 
@ leaflet-routing-machine.js:2900_routeDone 
@ leaflet-routing-machine.js:4693(anonymous function) 
@ leaflet-routing-machine.js:4645loaded 
@ leaflet-routing-machine.js:46

The app works with the mapbox router and the response looks slight different (different order).

1 Answer 1

1

After comparing responses from a commercial server and my own server I found the problem: Leaflet routing machine (LRM) expects a route response containing:

The OSRM engine does not include instructions out-of-the-box in the response, these must be added on the server after the route is returned by OSRM. The osrm-text-instructions plugin does so nicely. osrm-text-instructions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.