Skip to content

feat: support URL parameters for layer presets and visibility (#1530) - #1563

Open
AlistairHeus wants to merge 3 commits into
Azgaar:masterfrom
AlistairHeus:feat-url-preset
Open

feat: support URL parameters for layer presets and visibility (#1530)#1563
AlistairHeus wants to merge 3 commits into
Azgaar:masterfrom
AlistairHeus:feat-url-preset

Conversation

@AlistairHeus

@AlistairHeus AlistairHeus commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for loading layer presets or specific lists of visible layers via URL parameters on load (#1530).

Parameters

  • preset: applies a preset on load (e.g., ?preset=Religions Map).

Matches keys case-insensitively or by display name.

  • layers: toggles only the listed layers on and hides the rest (e.g., ?layers=provinces,borders,lakes,rivers).

Matches against element IDs (with or without the "toggle" prefix) and display text.

Changes

  • Added applyURLLayers(params) in public/modules/ui/layers.js to parse the URL parameters and toggle the layer buttons.

  • Called applyURLLayers(params) from focusOn() in public/main.js , and layers are updated once map generation or data loading completes

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for afmg ready!

Name Link
🔨 Latest commit 9b1f5c0
🔍 Latest deploy log https://app.netlify.com/projects/afmg/deploys/6a7b5c26523ae600085f170b
😎 Deploy Preview https://deploy-preview-1563--afmg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Azgaar
Azgaar self-requested a review August 7, 2026 11:22
Comment thread public/main.js
Comment thread public/modules/ui/layers.js Outdated
@Azgaar

Azgaar commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Hello and thanks for the contribution! It looks good overall.

Pass shared searchParams into applyURLLayers and shorten URL keys to preset and layers per maintainer review.
@AlistairHeus

Copy link
Copy Markdown
Contributor Author

Hi @Azgaar , Not sure if I've done something incorrectly here. There's a playwright test that is failing only on the CI

@Azgaar

Azgaar commented Aug 12, 2026

Copy link
Copy Markdown
Owner

That's ok, no worries. I will merge this later, need to complete other tasks first. As you see we have a lot of PRs noways.

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.

2 participants