Questions tagged [leaflet-routing-machine]

Leaflet Routing Machine is an easy, flexible and extensible way to add routing to a Leaflet map. Using the default is just a few lines of code to add fully functional routing, but you can still customize almost every aspect of the user interface and interactions.

84 questions
0
votes
0 answers

How can i calculate routes but not draw them on the map? Leaflet

i have been trying to get this working for quite some time now, but cyclic references from the routes objects, asynchronous execution and whatnot made it hard for me to see the bigger picture. I am also new to this, as one might have guessed. So i…
marian
  • 27
  • 7
0
votes
1 answer

Delete/Remove only the route and not route points using spliceWayPoints

I am using leaflet for maps and using leaflet routing machine to create routes between the locations. But unable to find a way to manipulate the waypoints. so that i can hide routes between 2 points. If there are only 2 locations then it works…
Himanshu G
  • 169
  • 5
0
votes
1 answer

How to dynamicallly pass the routing coordinates to leaflet-routing using react hooks

I am trying to create an app that will take source and destination location from the autocomplete box and the map shows the route between the two points: I have used the two useState to store the value for Source and Destination. After that, I am…
0
votes
0 answers

SVG Path length in Leaflet Routing Machine

I am using Leaflet Routing Machine to create map route. My requirement is, if there are multiple locations like A, B, C, D, E. I am getting the length of svg path from A to E. But i need length form A to B, B to C, C to D, D to E. Please help…
0
votes
0 answers

geocoder: L.Control.Geocoder.nominatim(), is not working angular

i try it many time but no resullt the problem that i want to dispaly depart address and destination address but i found thar erreur this.routing = L.Routing.control({ waypoints: [ ... ], language: 'fr', …
0
votes
1 answer

how to access _selectedRoute leaflet?

how can I access this _selectedRoute in my code? i need it to save instructions and summary let routing = L.Routing.control({ waypoints: [ L.latLng(20.97912897266421, 105.78617941902107), L.latLng(21.0033696728394,…
0
votes
1 answer

Extending Leaflet Routing Machine to work with Here Maps

Leaflet Routing Machine provides an easy way to integrate directions capabilities in Leaflet. Out of the box it used to work with MapBox but it is a while since it has been updated and I find thaat it does not quite work anymore. In any case I want…
DroidOS
  • 8,530
  • 16
  • 99
  • 171
0
votes
1 answer

How to add predefined places/markers to Leaflet Geocoder

I am using Leaflet Map with geocoder (ESRI) and Routing Machine. I have added two markers, let's say my home and my work var marker_work = L.marker([50.27, 19.03], { title: 'MyWork'}).addTo(map) .bindPopup("work").openPopup(); var marker_home =…
Tikky
  • 1,253
  • 2
  • 17
  • 36
0
votes
1 answer

How can i prevent popup to be closed when i have fitSelectedRoutes:true options selected in the routingControl

I am using leaflet and leaflet routing machine control libraries. When i am creating some route path i have the folllowing code: this.routingControl = L['Routing'].control({ router: L['Routing'].osrmv1({ serviceUrl:…
user14657384
0
votes
1 answer

leaflet routing machine HTTP request failed

I want to calculation the duration between to geolocalisation using leaflet routing machine but i got this error. > message: "HTTP request failed: error" status: -1 target: ProgressEvent > {isTrusted: true, lengthComputable: false, loaded: 0, total:…
0
votes
0 answers

Create a route with coordinates Leaflet OSRM

With OSRM and Leaflet, I need to create a route. What the user do : select (multiple or single) any itinerary (polyline) displayed on map when they are selected the user can create the route How can i create a route from coordinates of they…
0
votes
1 answer

MapBox Leaflet Routing machine not recognized

I'm building a small site with a map. I need a routing by foot so i considered switching from the osrmv1 test server to MapBox for my test because osrm test server only provide driving. i try to change the Routing as so: const options = { profile:…
0
votes
1 answer

Leaflet Routing Machine - Route Control: how to add a click listener to each instructions in the itinerary table?

currently, the default action when clicking part of a route is that it will zoom into that coordinate on the map. im currently trying to add a text to speech that will say out the instructions for that particular part. but how do i modify the click…
0
votes
1 answer

Custom leaflet geocoder marker

I wanna change the default Marker of leaflet geocoder, for that I overrided the markGeocode function and added it to the Control geocoder like that (using typeScript): const geocoder = L.Control.geocoder({ position: 'topright', …
0
votes
1 answer

Customize leaflet routing error (options)

I am using Leaflet-routing-machine, I added the error control to my map like this : L.Routing.errorControl(this.control).addTo(map); for style I used this : .leaflet-routing-error { width: 320px; background-color: rgb(238, 153, 164); …