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

Sharing exact map view #26

Open
4 of 5 tasks
eddy-geek opened this issue Dec 21, 2021 · 2 comments
Open
4 of 5 tasks

Sharing exact map view #26

eddy-geek opened this issue Dec 21, 2021 · 2 comments

Comments

@eddy-geek
Copy link
Contributor

eddy-geek commented Dec 21, 2021

Currently we have

  1. custom map sharing
  1. track sharing, that can be (ab)used to change displayed map like this:

Based on quick testing I don't think either can be used to

  • share exact current map view (base+overlays+location+zoom)
  • ...especially if maps are hidden or custom

Some propositions to extend tracks sharing:

I might PR some of this, what do you think?

@opoto
Copy link
Owner

opoto commented Dec 21, 2021

Hi

I understand it could be useful to configure a map view through URL parameters, although WTracks is more about editing/showing/sharing tracks than maps.
As a general and privacy preserving rule, whatever you pass in the URL should not persistently change the user configuration without explicit user consent (prompt explaining what will change and offering Ok/cancel, as in map import).

What I think could be useful and sufficient for your needs would be:

  • allow to pass a list of overlays, eg "&overlays=Hills,MTB"
  • a map parameter in URL is displayed even if it is hidden in the user preferences. A prompt may ask to change user settings to unhide it persistently.

Supporting map import together with external track loading would require a significant refactoring, and it would increase the loading time of the landing page. I feel it is simpler to keep it a separate operation (still a single click)

To share an area with a specific zoom, one can draw a rectangle-shaped track surrounding this area, and share that track.

PRs are always welcome!

@eddy-geek
Copy link
Contributor Author

eddy-geek commented Dec 22, 2021

As a general and privacy preserving rule

I understand the privacy & perf concerns for the imports. But for the hidden maps I would say "practicality beats purity". Especially since un-hiding the map just make available a curated (by you) map, so not that much of a security issue.

Also, right now you haven't implemented this links are transient instead of persistent strategy: if you click the tracks sharing links above, they will change your "remembered map". There's also an argument to be made for this, where the mental model "the app remains in the last seen state" may be a more consistent UX than "some stuff is remembered but not all" especially without a careful visual language around what does it mean to be in a transient session.

WTracks is more about editing/showing/sharing tracks than maps ... To share an area with a specific zoom ... share that track

You forgot creating 😄. It means I may want to share a link that allow people to start drawing right away without fiddling with settings or removing a weird rectangle.

It's especially important to be able to share a location when the map I'm linking to does not cover the whole world, especially the default (0,0) start position. Concretely, if I recommend on a Spanish forum to use https://opoto.github.io/wtracks/?map=SP%20IGN%20Raster to start creating tracks, the experience is not great (try opening in incognito window, and not sharing location).

This is the case for a majority of the WTracks out-of-the box maps now (as the best quality maps are always local ones). We can't even have WTracks center on a covered area by default, since there's no standard for XYZ tile APIs to share map bounds, that would only be feasible for the other, rarer map types.

PRs are always welcome!

Thanks for sharing, I'll see what I can do!
Can you point me to the current ?map=... parsing code ? → The keyword is getParameterByName

eddy-geek added a commit to eddy-geek/wtracks that referenced this issue Dec 23, 2021
eddy-geek added a commit to eddy-geek/wtracks that referenced this issue Dec 23, 2021
eddy-geek added a commit to eddy-geek/wtracks that referenced this issue Dec 23, 2021
* Not yet implemented in track sharing URL generation
* Transient: will not be shown on next refresh (should be made consistent with behaviour for ?map one way or the other)
* Hidden overlays are shown (transient as well)
Examples:
- Multi: http://localhost:8000/?map=OpenStreetMap&overlays=Hills,Cycling
- Hidden: http://localhost:8000/?map=OpenStreetMap&overlays=FR%20IGN%20Parcelles
Part of opoto#26
eddy-geek added a commit to eddy-geek/wtracks that referenced this issue Dec 23, 2021
Behaviour on refresh and for hidden overlays is similar as for `?map`...
... except there is a preexisting issue right now where enabled overlays are not shown on refresh, but they are in the shared URL.

Examples:
- Multi: http://localhost:8000/?map=OpenStreetMap&overlays=Hills,Cycling
- Hidden: http://localhost:8000/?map=OpenStreetMap&overlays=FR%20IGN%20Parcelles

Part of opoto#26
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

2 participants