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

Always use coordinates when using directions from context menu #5099

Merged

Conversation

AntonKhorev
Copy link
Collaborator

Part of the problem #5064 tries to solve are the result of the context menu using addresses from endpoint inputs.

You right click somewhere, select "Directions from here" and it goes to and url like this: /directions?from=51.420436%2C-0.174805&to=. Then you right click somewhere else, select "Directions to here" and the url becomes something like this: /directions?from=Park%20Road%2C%20Collier%27s%20Wood%2C%20London%20Borough%20of%20Merton%2C%20London%2C%20Greater%20London%2C%20England%2C%20SW19%202HT%2C%20United%20Kingdom&to=51.420563%2C-0.171007. The coordinates in from got replaced by an address. It's impossible to get the original coordinates from an address.

The solution here is to save the coordinates to data-lat and data-lon attributes of inputs. The context menu then can generate directions urls using the values stored there.

This doesn't solve the entire problem because there's also uncontrolled reverse geocoding decided by Nominatim when using its freeform query.

@AntonKhorev AntonKhorev force-pushed the directions-endpoint-lat-lon-data branch from cfbde45 to a088b13 Compare August 20, 2024 11:56
Copy link
Contributor

@nenad-vujicic nenad-vujicic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great on my side, thanks!

@tomhughes
Copy link
Member

Looks good to me, thanks.

@tomhughes tomhughes merged commit 20f8fad into openstreetmap:master Aug 20, 2024
24 checks passed
@AntonKhorev AntonKhorev deleted the directions-endpoint-lat-lon-data branch August 21, 2024 08:29
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

Successfully merging this pull request may close these issues.

3 participants