mercredi 1 septembre 2021

Get all generated route points (of lines) to check if you hear route deviation - Leaflet Js [duplicate]

I create the route using Leaflet to plot the generated route on the map.

L.Routing.Control({
    waypoints: receivedWaypoints,
    routeWhileDragging: true,
    fitSelectedRoutes: true,
    router: new L.Routing.orsmv1({language: 'pt-br', profile: 'car'}),
}).addTo(map);

I need to get the route points, so that every X seconds I check if the vehicle is within the route, if not, check the distance from the point where it is from the points closest to the route initially generated to check if it is outside the limit de-route allowed.

I want to receive the coordinates of each point of the entire route, for example: if it contains 3 lines -> A _/\ B, I want to get the coordinates of each end of those lines. being that I only passed two points the beginning of the route and the end of the route

Is there a way to get these points in Leaflet, if so how do I do it?

Thanks.




Aucun commentaire:

Enregistrer un commentaire