perliedman / leaflet-routing-machine

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

message : "TypeError: Cannot read properties of undefined (reading 'Poly') #690

Open muhamedoufi opened 1 year ago

muhamedoufi commented 1 year ago

Hi there, before submitting a new issue, please consider the following:

    // 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

curtisy1 commented 1 year ago

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?

  1. 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)
  2. 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)
  3. Tell me which version of leaflet and LRM you're using and how you load them (unpkg, webpack, etc.)