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

Persist map settings / add map settings to URLs #517

Open
9 tasks
Tracked by #246
ezwelty opened this issue Oct 17, 2024 · 0 comments
Open
9 tasks
Tracked by #246

Persist map settings / add map settings to URLs #517

ezwelty opened this issue Oct 17, 2024 · 0 comments
Labels
enhancement New feature request
Milestone

Comments

@ezwelty
Copy link
Collaborator

ezwelty commented Oct 17, 2024

We will eventually need to support the many legacy url parameters (see #246) that control map settings:

https://fallingfruit.org/?z=11&y=47.41426&x=8.55928&m=true&t=roadmap&l=false&c=forager,freegan

  • x, y, z – Map longitude, latitude, and zom: Either map to @{y},{x},{z}z (as used now) or rename @{y},{x},{z}z to x={x}&y={y}&z={z}
  • m (default: 'true') – Municipal tree inventories: Set settings checkbox state and map to GET api/locations?muni=.
  • f – Location types (comma-separated type ids): Set type filter state and map to GET api/locations?types=.
  • c (default: 'forager,freegan') – Location type categories (forager, freegan, grafter, honeybee): Map to type filter based on type.categories returned by GET api/types.
  • t (default: 'roadmap') – Map type ('roadmap': Google default, 'hybrid': Google satellite, 'terrain': Google terrain, 'toner-lite': Stamen toner-lite, named here 'osm-toner-lite' but could be renamed back to 'toner-lite', 'osm': OpenStreetMap standard, named here 'osm-standard' but could be renamed back to 'osm'). Legacy URLs do not support overlays (bicycle and transit).
  • l (lowercase L) (default: 'false') – Location labels: Set label checkbox state

At the same time, there are good reasons to persist map settings so that they survive map refresh (#516). Even better, that they persist between visits on the same device, as the language selector appears to do already.

So to recap:

  • Load settings from legacy url parameters
  • Write settings to local storage (cookie?) alongside language
  • Write settings to URL (ideally, matching and extending legacy params) without adding a new state to browser history
@ezwelty ezwelty added the enhancement New feature request label Oct 17, 2024
@ezwelty ezwelty added this to the Beta release milestone Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

No branches or pull requests

1 participant