Skip to content

fix(map): sync layer toggles to URL for shareable links#621

Merged
koala73 merged 1 commit into
mainfrom
fix/shareable-url-layers
Mar 1, 2026
Merged

fix(map): sync layer toggles to URL for shareable links#621
koala73 merged 1 commit into
mainfrom
fix/shareable-url-layers

Conversation

@koala73

@koala73 koala73 commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Closes #576

Summary

  • Layer toggles now update the browser URL in real-time (debounced 250ms)
  • Shared links carry the exact layer state the sender had active
  • Extracted debounced URL sync from setupUrlStateSync to a reusable class method (debouncedUrlSync)
  • Called from setupMapLayerHandlers on every layer change

What was broken

setupUrlStateSync() only listened to map.onStateChanged() (zoom/pan/view). Layer toggles saved to localStorage and tracked analytics but never updated the URL. Copying a link after toggling layers would share stale layer state.

Test plan

  • Toggle layers on/off → verify URL layers= param updates in browser address bar
  • Copy URL after toggling layers → open in incognito → verify same layers are active
  • Verify zoom/pan/view/timeRange still sync to URL as before

Layer toggles were not updating the browser URL, so shared links
would not carry the user's current layer state. Extracted the
debounced URL sync to a reusable class method and call it on
every layer change.
@vercel

vercel Bot commented Mar 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Building Building Preview, Comment Mar 1, 2026 0:48am
worldmonitor-finance Building Building Preview, Comment Mar 1, 2026 0:48am
worldmonitor-happy Building Building Preview, Comment Mar 1, 2026 0:48am
worldmonitor-startup Building Building Preview, Comment Mar 1, 2026 0:48am

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@koala73
koala73 merged commit 364c587 into main Mar 1, 2026
6 checks passed
koala73 added a commit that referenced this pull request Mar 1, 2026
Layer toggles were not updating the browser URL, so shared links
would not carry the user's current layer state. Extracted the
debounced URL sync to a reusable class method and call it on
every layer change.
matthewvecchione1-ops pushed a commit to matthewvecchione1-ops/worldmonitor that referenced this pull request Mar 4, 2026
…koala73#621)

Layer toggles were not updating the browser URL, so shared links
would not carry the user's current layer state. Extracted the
debounced URL sync to a reusable class method and call it on
every layer change.
@koala73
koala73 deleted the fix/shareable-url-layers branch March 4, 2026 19:40
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.

Shareable link

1 participant