vtshaver icon indicating copy to clipboard operation
vtshaver copied to clipboard

Supporting runtime style

Open zmofei opened this issue 7 years ago • 1 comments

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.

  1. 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.

  2. 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

zmofei avatar Dec 18 '18 03:12 zmofei

In https://github.com/mapbox/vtshaver/commit/b4a610f99eeecc17406a9ae36de68ed49a525bf6 :

  1. 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]
        }
    }
}
  1. Support pass a param with properties to 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

zmofei avatar Dec 18 '18 09:12 zmofei