leaflet-routing-machine
leaflet-routing-machine copied to clipboard
message : "TypeError: Cannot read properties of undefined (reading 'Poly')
Hi there, before submitting a new issue, please consider the following:
- [ ] This is actually an issue with Leaflet Routing Machine, not a question
- [ ] You have read the Leaflet Routing Machine documentation and tutorials there is my code
// create the routing control and add it to the map var routCtrl = new L.Routing.control({ waypoints:[ L.latLng(18.0928, -15.9611), L.latLng(18.084189686687818, -15.966320625599066) ], router: L.Routing.osrmv1({ serviceUrl: 'http://127.0.0.1:5000/route/v1' }), }).addTo(map);
i use my self hosting for osrm as docker image
This is definitely interesting. I suspect it happens when OSRM fails to find a route and as such does not return a proper polyline. Can you please do the following to help me troubleshoot this?
- If you have some sort of Javascript call stack or stack trace, please paste all of it here as I currently have no idea what a Poly is (except for it being undefined)
- Run a test request against your local docker image to see if the request works. You can use cURL and simply replace this url with your localhost/127.0.0.1 (as you can see, the official demo server returns no route)
- Tell me which version of leaflet and LRM you're using and how you load them (unpkg, webpack, etc.)