Comments (6)
I’ll start working on this issue once 13 people react positively to this comment. :)
from maputnik.
We should use your merge strategy 👍
But the problem for us stemmed more because we were iterating on the vector tile schema and field values and layers were changing.
I guess a common pattern is that you have a base style (with some layers) and then a lot of other styles are just layers on top of that or changed colors.
Perhaps one idea would be to specify a base style URL in the metadata (which would be displayed as immutable layers) and only the layers on top of it can be edited.
But that solves kind of a limited use case.
My goal is that we always operate on a valid JSON style as described by the Mapbox GL style spec. If we have additional needs it must be described via metadata.
That's also why I am not sure variables are a good idea.
from maputnik.
There are various approaches that came to my mind, that could possibly be implemented in Maputnik (just some quick ideas):
A. Includes
The CSS way. Layers could be bundled into sub-stylesheets that could be included into styles. This would make sure that , yet as (unlike with CSS) that's not part of the GL spec this would create a Maptnik-proprietary format that would have to be converted to standard GL files in the end.
Another downside would be that a setup of includes that really fits a specific use case well would require quite some brainwork, as we know from the CSS world. Not very novice user friendly.
B. Copy/Merge on file basis
Basically a replication of the workflow I described above: The possibility to display the difference between to styles in some way (map? comparison slider?), with the option to transfer selected differences from one style to another.
C. Copy/Merge on layer basis
A layer could have a function "Copy layer to another style". The user would select a target style and Maputnik would check if that layer existed (by layer name? or maybe by comparing filters). If not, it would be added (on the same position if possible). If yes, a JSON diff view could show differences and let the user accept or cancel.
If Maputnik knew all my styles (e.g. all the styles in my Github repo) than the function could be "Copy layer to [layer list dropdown]".
D. Variables
Variables that are configured somewhere centrally. Also proprietary, such as A.
(And yes, all these options assume that all styles are similar, share layer names, etc. Such a feature wouldn't make much sense between completely unrelated styles.)
from maputnik.
I think the discussion is really interesting - hence I'll keep it open.
However I don't think that I will provide a solution for this any time soon - since this is one of the more advanced features - while it is probably better to work on the lower hanging fruits that can still be improved.
from maputnik.
Being able to have a "base" style and then add new layers or change properties of "base" layer (without changing the base style itself) would be very useful!
For example if we have a number of base layers (general, topo, light, dark, ortho etc.), it should be possible to create new derivative styles (thematic maps) and update those thematic styles easily when base style changes.
(do not know how much this is in line with Mapbox plans: mapbox/mapbox-gl-js#4225)
from maputnik.
I guess the complexity comes with the ordering of layers. For example with a base map in which you want to add a traffic layer this would sit in between the two layers in the original style.
road <--- base style
transit overlay
road label <--- base style
from maputnik.
Related Issues (20)
- Live performance benchmarks HOT 1
- Migration fix-ups in https://maplibre.org/maputnik HOT 2
- Run old versions of Maputnik HOT 3
- Why does https://maplibre.org/maputnik fetch http://localhost:8000/styles ? HOT 7
- [Feature] let us filter! HOT 2
- Inspect's popup truncates the property values HOT 4
- MapTiler Access Token does not get added to URLs HOT 5
- Cannot type "0.5" in an Opacity field
- Re-initialize map view after changing style HOT 22
- Switching to OpenLayers and back to MapLibre hides all styles HOT 1
- `maputnik.github.io` should use `maplibre.org/maputnik` editor HOT 6
- unable to upload style HOT 5
- Tiles do not load when first loading another style HOT 4
- Upgrade codemirror
- add toggle `localIdeographFontFamily` options of MapLibre GL JS for CJK fonts HOT 3
- Broken links on the wiki HOT 2
- unknown property "fill-extrusion-vertical-gradient" HOT 1
- Styles not loading - self hosted map server HOT 5
- Vector XYZ data source is not shown in Inspect view HOT 2
- Update the Gallery styles (MapTiler Basic, Dark Matter, Position, OSM Bright and Toner) to the latest version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maputnik.