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

Adding waypoints #343

Open
Hard-Loader opened this issue Oct 28, 2021 · 4 comments
Open

Adding waypoints #343

Hard-Loader opened this issue Oct 28, 2021 · 4 comments

Comments

@Hard-Loader
Copy link

With a freshly loaded osrm-frontend, clicking on the map sets the start marker and a second click sets the end marker.

Subsequent clicks always update the second waypoint, whether or not extra waypoint spaces have been added or selected. This does not seem like expected behaviour. I would expect each subsequent click to add a marker after the currently selected list entry.

Is this something that might be changed in future?

I am currently testing a script that inserts routes into the map by repeatedly calling the addWaypoint() function. This only works for the start and end points, for the reasons above. Is there a workaround that would allow each point to be assigned in order to the list?

@Hard-Loader
Copy link
Author

I've taken a closer look at what's going on. It's an easy change to make new markers add to the list rather than over-writing the last value. Line 204 in /src/index.js currently reads as "if (length === 1) length = length + 1;" changing that to "if (length > 0) length = length + 1;" will add a new entry for each click on the map.

I think that's more intuitive behaviour than the way it works at the moment.

@mjjbell
Copy link
Member

mjjbell commented Oct 29, 2021

Subsequent clicks always update the second waypoint, whether or not extra waypoint spaces have been added or selected. This does not seem like expected behaviour. I would expect each subsequent click to add a marker after the currently selected list entry.

I agree, this does feel unintuitive. Your suggestion makes sense to me.

@robinsonkwame
Copy link

Note: if you copy and paste another address and enter it into an empty via point and press enter you can add more than a stop and start. Very odd but it is what it is.

@datendelphin
Copy link
Contributor

I think the main intended "work flow" for via points is dragging the route. But it makes sense to just add waypoints with each click.

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

No branches or pull requests

4 participants