perliedman/leaflet-routing-machine

Steps in the cableway

thoarca opened this issue · 5 comments

Hi there,
how can connect two points in cableway, using leafletmap ?

Thanks

I'm guessing you would want a polyline? Or is it that you want to find the route between two stations on a cableway?

Hi,
thanks for the reply.
My goal is to derive a route between two points of a exiaisting cableway. If possibile, this path will be a polyline, right?
thank you

Yes. Suppose you have a set of points, you could simply do the following

const points = [51.65464, 14.5756], [51.5785, 14.87575]; // your coordinates
const line = new L.Polyline(points);
line.addTo(map);

or if you want routing, you could use something like this

L.Routing.control({
    waypoints: [
        L.latLng(57.74, 11.94),
        L.latLng(57.6792, 11.949)
    ],
}).addTo(map);

although I'm not sure, how accurate the result would be since cableways are not usually included in OSRM routes as far as I know

Is it possible that you show me some sample code of what you want to achieve? I'm still not sure whether you really want all the routing overhead when you know your waypoints and could just create a route between them