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 to show the selected route and alternate routes in leaflet

i have one requirement to show the user selected route first and user can able to switch the route by selecting other routes, currently i can able to show the route with showing alternate routes, is there any way to select specific route by default…
0
votes
0 answers

is it possible to get all the coordinates of a route without adding it to the map?

For example: When I add a routingControl to the map, I have all the route coordinates in this object: const routingControl = L.Routing.control({ waypoints: route.points, }).addTo(map) console.log("routingControl", routingControl) In…
0
votes
1 answer

How to use React useContext with leaflet routing machine and react leaflet?

I'm trying to use a useContext hook inside a react-leaflet controlComponent but I have an error when my context fires the update function. I use a react-leaflet controlComponent because of leaflet routing machine. I think the code + the error are…
0
votes
0 answers

How to create a visible route/path on leaflet map?

I have an app which allows a user to see a route between his location and the place they want to get to, and im having difficulties showing the route however the 2 markers show up. //Passing lat and lon value from a django template variable const…
0
votes
0 answers

How do i make my route path visible on a leaflet map?

I have a functionality in website that gets the users coordinates and create a route to the place where the user it going. like so http://www.liedman.net/leaflet-routing-machine/tutorials/basic-usage/ . However, it is not working i cant seem to…
0
votes
1 answer

React Leaflet => Sidebar render twice

here I got a bug that from yesterday until now got the solution. So the bug is that the sidebar appears 2 times as shown in the picture. What do you think the solution is? Thank you, I really appreciate your help. My…
Kia Kalista
  • 301
  • 1
  • 3
  • 12
0
votes
1 answer

Reactjs =>leaflet-routing-machine waypoint render 2 times

here I get a bug when trying the leaflet-routing-machine lib. The bug is that the "Waypoints" section renders 2 times. why is it able to render 2 times? Can you guys help me? Thank you My Code in below =>
0
votes
0 answers

Reactjs =>leaflet-routing-machine interaction

So, I followed the tutorial here https://www.liedman.net/leaflet-routing-machine/tutorials/interaction/ but i get an error when i click the button "Start from this location" I get an error like this= uncaught TypeError: Cannot read properties of…
Kia Kalista
  • 301
  • 1
  • 3
  • 12
0
votes
0 answers

How would you make this Leaflet Routing Controler global?

I am relatively new to using Leaflet and the Leaflet Routing Machine by Liedman. My current issue: I need to make my control var global, but aint able to define it either outside the function or with window. because of the following .remove()…
PhilippS
  • 1
  • 3
0
votes
1 answer

Why does my custom OSRM server not give alternative routes as map.project-osrm.org?

I have set up a custom OSRM server using docker as explained here. And I have a web application which shows routes between 2 locations. I am using leaflet routing machine which pointed to the custom OSRM server as follows, L.Routing.control({ …
Abraham Arnold
  • 301
  • 4
  • 20
0
votes
0 answers

Leaflet/Leaflet Routing Machine: Is there a method to determine if a Lat and Lang is on the street?

Using leaflet-topography I can get the elevation and slope data for a given point using Lat and Lang. I got that data: latlng: LatLng {lat: 40.74224422475555, lng: -73.76170149999999} topography: aspect: 279.4623222079068 elevation:…
Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141
0
votes
1 answer

Cannot extract merged .osm.pbf OSRM file using docker

I merged the following .pbf countries I have extracted from geofabric(using osmosis): Italy, Slovenia, Croatia, Bosnia, Montenegro, Albania. The order I merged them: Italy&Slovenia Croatia&Bosnia Monenegro&Albania then merged the results of this…
0
votes
1 answer

Export GPX route from leaflet map

I'm trying to find a way of producing a GPX string from a Leaflet map so I can then save it into my DB. I am using Leaflet Routing Machine to create the route and then display it on an embedded map. So far, I found many ways to import a GPX to…
0
votes
3 answers

React leaflet display simple route

I want to display a route between 2 or more coordinates. I don't want any fancy direction instructions or start and end markers. So basically something like a that goes along roads. I know there is a leaflet-routing-machine, but I…
0
votes
1 answer

how to add leaflet routing machine control to another div instead of map: react-leaflet

I want to display routing machine control div on dashboard (collapse side bar like google maps) instead of map div, because it is covering the map on mobile version. is there any easier way to do that? I have tried this 2 ways : appending control…
Saidamir
  • 134
  • 2
  • 12