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

iD: listen to URL hash changes #5394

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Dec 11, 2024

When the map hash parameter is changed (and was not not triggered by map interaction from inside iD itself): pan to the new location.

This mirrors the behaviour when manually editing the map hash parameter on osm.org outside of iD.

This also fixes openstreetmap/iD#10592 (error in js console when iD is opened outside of an iframe by directly navigating to osm.org/id).

Pan to the new `map` location when the hash change was not not triggered by map interaction from inside iD itself.

This mirrors the behaviour when manually editing the `map` hash parameter on osm.org outside of iD.

This also fixes openstreetmap/iD#10592 (error in js console when iD is opened outside of an iframe by directly navigating to osm.org/id).
@tomhughes
Copy link
Member

Looks good to me, though I would not that using openstreetmap.org/id directly is not really supported - it's an internal implementation detail that we certainly don't guarantee.

@tomhughes tomhughes merged commit 326d4ec into openstreetmap:master Dec 12, 2024
22 checks passed
@tyrasd tyrasd deleted the iD-listen-hashchange branch December 12, 2024 18:16
@tyrasd
Copy link
Member Author

tyrasd commented Dec 12, 2024

using openstreetmap.org/id directly is not really supported

👍 agree

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.

Error while loading iD at https://www.openstreetmap.org/id
2 participants