Supporting runtime style
Even though vtshaver is not designing for runtime style, we still want to make efforts to make things better.
Now we have two experimental ideas. This ticket is to track the process of support runtime style.
-
Style specific retain, we want to make some special marks in style specific, to mark which properties in a particular layer we want to use, then the vtshaver will keep the certain properties.
-
Query properties, vtshaver well accept a param to determine which properties the user want to use, then return the shaved tiles+the certain properties. For the client side, every time user wants to change the style, the client can access tile with the certain properties in query(like
vector.pbf?styl=<path to style>&keep={"country_label" : ["name_ru", "name_de", "name_es"]}).
cc w/ @springmeyer
In https://github.com/mapbox/vtshaver/commit/b4a610f99eeecc17406a9ae36de68ed49a525bf6 :
- Add supprot to read retain form style's metadata
// style.json
{
"metadata": {
"mapbox:retain": {
"landuse": ["p6"],
"water": ["all properties will already be kept so this value does not matter"],
"test": [true]
}
}
}
- Support pass a param with
propertiesto styleToFilters to determine with properties to keep
const style = ****
const options = {properties: {road: ['name_en']}};
var filters = shaver.styleToFilters(style, options);
- [ ] More unit test need to add
- [ ] Update up/down stream