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

Prevent map position changes to add to browser history #405

Open
vmarc opened this issue Apr 10, 2024 · 2 comments
Open

Prevent map position changes to add to browser history #405

vmarc opened this issue Apr 10, 2024 · 2 comments
Assignees

Comments

@vmarc
Copy link
Owner

vmarc commented Apr 10, 2024

In the Safari browser, each time the map position is changed by zooming or panning, a new entry is added to the browser history (url query parameter change). This kind of pollutes the browser history, and can be a reason for not using this browser for knooppuntnet.

It would be useful if this could be prevented.

Chrome and Firefox do not do this (no history entries when query parameters change).

@vmarc vmarc self-assigned this Apr 10, 2024
@vmarc vmarc moved this to Todo in knooppuntnet Apr 10, 2024
@vmarc
Copy link
Owner Author

vmarc commented Jun 15, 2024

Closing this issue as it seems nothing can be done about this.

The history behaviour is the same in openstreetmap.org, waymarkedtrails.org, google maps and OpenLayers example code.

The history in the popup window that is shown after a long press on the browser backbutton does not have the problem.

history

@vmarc vmarc closed this as completed Jun 15, 2024
@vmarc vmarc removed this from knooppuntnet Jun 15, 2024
@vmarc
Copy link
Owner Author

vmarc commented Jun 17, 2024

Issue re-opened.

After thinking about this again, there is a simple way to prevent pan/zoom actions to fill the browser history: just do not include the position in the query parameters when they are updated.

The drawback is that a simple copy of the current url does not work anymore to share a link containing the current map position with another user.

But this could be solved by a menu option "Copy link" that could be used to copy the full url containing the position to the clipboard. For example:

image

Another option would be to have a "share" link or a copy button (similar to this one found in the GitHub project issue page) on every page :

image

@vmarc vmarc reopened this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant