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

Map style toggle #1610

Open
RyanTG opened this issue Oct 3, 2024 · 1 comment
Open

Map style toggle #1610

RyanTG opened this issue Oct 3, 2024 · 1 comment

Comments

@RyanTG
Copy link
Collaborator

RyanTG commented Oct 3, 2024

Seems like you have to add an event listener. https://www.jawg.io/docs/integration/maplibre-gl-js/change-style/

https://docs.mapbox.com/mapbox-gl-js/example/setstyle/

https://github.com/maplibre/maplibre-gl-js/discussions/929

I am working on putting the hex/hsl values in variables, then hopefully those can be switched out and the map reloaded, rather than having two distinct style json files. Somewhat similar to this https://github.com/protomaps/basemaps/blob/360f5434dc2e89c976da2118899b3e0e46fa986b/styles/src/themes.ts#L177

@RyanTG
Copy link
Collaborator Author

RyanTG commented Oct 14, 2024

Initial commit a980fd9

Leaving open in case we want to add a manual toggle, too.

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

No branches or pull requests

1 participant