|
|
|
|
|
by murphy214
2356 days ago
|
|
I haven't done this but I imagine you could put a service worker that has a fetch event listener that puts you in front of the raw tile data being cached. https://github.com/mapbox/mapbox-gl-js/issues/4326 From their you can serialize/deserialize the whole tile and map a new field (annoying), or if your clever... map your variable value fields lower in the values index array of the vt pbf. That way assuming you have a small number of unique style by values, you could get away with simply replacing a single byte representing that style value field with another value dictating a different style, for each feature in the vector tile. That might be a little to abstract so tl:dr version put a listener in front of fetch. One byte represents the target dynamic field in each feature in the tile (if you have a small number of unique values). Replace that single byte with your desired target byte. |
|