-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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-wide variables #8404
Comments
We used to have style classes, but removed them because they were hard to design for in Studio and the use case was perceived to be obscure. I've found them useful. |
Duplicate of #7946 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Expressions can respond to three things (afaik): properties of the data, zoom, and temporary feature state of the data. But sometimes it would be helpful to respond to something map-wide, like a "dark mode" or whether a satellite basemap is present, or whether the user has requested large fonts.
Design Alternatives
Currently, the way to handle this is to call
map.setPaintProperty
on each specific layer when that map-wide property changes. But that's not ideal, because it often means defining layer properties twice: once as initially shown, and then later when reset:Design
Something like:
The text was updated successfully, but these errors were encountered: