80 questions
0
votes
1
answer
54
views
How to add a marker on Angular for Leaflet Routing Machine
I currently have this code here where I want to add custom icon that I will design.
plotRoute(): void {
if (this.selectedOrder) {
this.primengTableHelper.showLoadingIndicator();
...
0
votes
1
answer
616
views
Cant hide leaflet routing machine route instruction
I would like to hide or display this routing machine instruction in more pleasing way, but once I turn off the auto-route, waypoints route drawing is also turning off....I have also tried the show:...
0
votes
1
answer
259
views
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 ...
0
votes
1
answer
274
views
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 ...
0
votes
1
answer
1k
views
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 ...
1
vote
2
answers
307
views
Openstreetmap Itinerary
I'm working on a project and I need to display points of interest that are saved in a database.
For the itinerary, I used leaflet routing machine and nominatim.
Now I need to display those points of ...
3
votes
1
answer
2k
views
how to draw a route by array of points using leaflet-routing-machine?
I want to drag route from many point using leaflet and leaflet-routing-machine. I do not know How to pass all of locations into the waypoints.
import { useEffect, useState } from "react";
...
2
votes
2
answers
2k
views
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. ...
0
votes
3
answers
4k
views
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 <Polyline /> that goes along roads. ...
2
votes
1
answer
3k
views
Leaflet Routing Machine - update/redraw route
I'm new about Laflet Routing Machine (liedman) https://www.liedman.net/leaflet-routing-machine/ and I would like to update the first route calculated every 30 seconds because I would like refresh it ...
1
vote
1
answer
2k
views
leaflet routing machine - IRoute.summary.totalDistance
I am using Leaflet 1.2.0 and Leaflet Routing Machine 3.2.12.
My code is drawing the correct route on the map, yet, when i want to access the summary and the totalDistance from the summary, both are ...
0
votes
1
answer
1k
views
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 ...
1
vote
1
answer
1k
views
Missing properties error when using Leaflet in Angular
I am trying to use Leaflet and Leaflet Routing Machine. I used following commands to install leaflet and leaflet routing machine,
npm i leaflet
npm i --save-dev @types/leaflet
npm i leaflet-routing-...
6
votes
2
answers
12k
views
How to use Leaflet Routing Machine with React-Leaflet 3?
The old way of doing things in react-leaflet 2.8.0 was to use MapLayer and withLeaflet.
But now in react-leaflet:
MapLayer and withLeaflet are deprecated as of version 3.
I'm trying to grasp the ...
1
vote
1
answer
235
views
Leaflet to calculate the distance between 3 points - Search in javascript array object
I want to subtract the distance to the Leaflette waypoint from the total distance. How can I do that?
routes: Array(1)
0:
coordinates: (379) [D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D,...
0
votes
0
answers
19
views
geocoder: L.Control.Geocoder.nominatim(), is not working angular [duplicate]
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: [
...
...
1
vote
1
answer
2k
views
React Leaflet Routing Machine: onClick to add Marker after all waypoints are removed fires only after second click
I followed this recommendation from the Leaflet Routing Machine regarding interactions i.e. onClicks.
With my implementation, I'm saving the waypoints in local-storage—saving the latitude and ...
1
vote
1
answer
699
views
React useReducer: Payload is received, state not updated
I am using this article to help with using the useReducer hook.
I have created this context component because I am using the react-leaflet routing machine to create markers for the route and I'd like ...
0
votes
1
answer
698
views
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)
....
1
vote
0
answers
161
views
how can I load the waypoint coordinates from Asp Label.Text
First code in which i hardcore the value:
<script type="text/javascript">
function myfunction() {
var label3LatLng =
document.getElementById('<%=TextBox1.ClientID%>')....
0
votes
1
answer
555
views
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']....
1
vote
2
answers
6k
views
Leaflet Routing Machine hide route without using .remove()
How do should I hide the Leaflet Routing Machine route and markers on mouseout event?
Currently, I have regular Leaflet marker, that has mouseover/mouseout events. When mouseover event is fired and ...
0
votes
0
answers
497
views
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 ...
0
votes
1
answer
2k
views
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 ...
0
votes
1
answer
655
views
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: ...