-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Add ability to create a style with multiple themes #909
Comments
It does sound like a good feature to have. Thinking further on this:
Maputnik UI changes
JSON formatCurrent stylesheet format is well defined, can be validated with json schema, and would break if we use Instead, I think we may want to add a new Maputnik "editor file format" - different from "stylesheet format". The editor file format could store all sorts of additional data (e.g. data sources, variables, editor settings), and we would use an "export" command to actually produce a stylesheet. Editor JSON format
"variables": {
"$water": {
"_": "#001122", // default color for all styles
"dark": "#ffffff" // override for the dark theme
},
"$river_width": {
"_": 4,
"light": 6,
}
}
|
Wouldn't we want to "pre-compile" the style - i.e. simplify it before giving it to maplibre to speed it up? It's not like visualization needs to change often based on the variables. The switch between night/day mode would happen just a few times while driving (e.g. when going into a dark tunnel) - so might be better to have a distinct style that uses const values. |
From @klokan: Maputnik specific pre-processor - unrelated to MapLibre GL JS and Spec. Check: |
There is a need for the ability to build styles with multiple themes, such as light mode and dark mode. The current process is to clone the style and change every individual color, which is cumbersome and manual when there are frequent style changes. I would like to request a solution which Maputnik could edit a style using references to colors and numbers (or any type), which can be kept in a theme style sheet. Ideally, in a field using a style reference, you would still be able to edit the field as usual. However, based on the theme which is selected, it would update the reference value instead.
Then Maputnik could generate one style per theme, with the reference values in place.
Of course, this is just one possible solution to the issue, and open to discussion.
Rough example
Style building in Maputnik:
The text was updated successfully, but these errors were encountered: