perliedman / leaflet-routing-machine

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

No Event is fired #492

Closed zaven-azatyan closed 2 years ago

zaven-azatyan commented 5 years ago

Hi, I'm trying to get the route "steps" but actually it seems no event is fired. Here is my code.


var myPlan = new L.Routing.Plan([
    L.latLng(48.62564740882851, 1.9995117187500002),
    L.latLng(48.687733, 2.115663)
], {
    draggableWaypoints: false,
    createMarker: function(i, waypoint, n){
        return false
    }
});

var myControl = L.Routing.control({
    plan: myPlan,
    router:
        L.Routing.mapbox('MY_API_KEY', {language: 'fr'})
});

myControl.on('routingstart', function(e) {
    console.log(e)
});

myControl.on('routingerror', function(e) {
    console.log(e)
});

myControl.on('routesfound', function(e) {
    console.log(e);
});

The same code (except the events) works fine on another page and the route and control box is shown as it supposed to.

thanks in advance

perliedman commented 5 years ago

Hi, sorry for a late reply. Do you have any reproduction for this? It looks totally valid and should work.

curtisy1 commented 2 years ago

Cannot really do anything here without a reproducible code example. Since it's been a few years, I'll close this for now