Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to pass more than one waypoint ? #704

Open
ZeusPod opened this issue Apr 15, 2024 · 4 comments
Open

Is it possible to pass more than one waypoint ? #704

ZeusPod opened this issue Apr 15, 2024 · 4 comments
Labels

Comments

@ZeusPod
Copy link

ZeusPod commented Apr 15, 2024

Hello, nice to say hello, more than an error, it is a question. I need to know if it is possible to pass more than 2 waypoints since in the documentation the example only shows 2, and in different tutorials only 2 are passed, I try to pass more than 2 to simulate the route. from a GPS but I get strange behavior, it goes down a street and skirts an entire block, for example

image

@curtisy1
Copy link
Collaborator

Hi @ZeusPod,

You can definitely add more than 2 waypoints. In this example I added three but you could easily add more than that by adding another L.latlng to the array.

That being said, the route does look a little weird. I'm guessing the black markers are the waypoints? In that case it looks like the start waypoint is also the end and the route visits the other waypoints first, going through the smaller streets and then turns around and goes back the main route.
Then again, I would have expected it to go back on a highway.

If the problem persists, you would have to show me some of your code or provide a codepen (or similar) so I can have a look.

@ZeusPod
Copy link
Author

ZeusPod commented Apr 15, 2024

Hi @curtisy1 Thank you for answering my question. Here I show you a little bit of the code. I applied a reverse to the waypoints and it looks much better since it was bringing me the data in descending order from the database.

image

@tvjmohan
Copy link

You can add more....

@ZeusPod
Copy link
Author

ZeusPod commented Apr 17, 2024

You can add more....

Thanks so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants