mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.17k stars 2.22k forks source link

Synchronize StyleLayer and Bucket/Buffer state #4012

Open anandthakker opened 7 years ago

anandthakker commented 7 years ago

The state needed by the painter_xxx modules to render tiles is split up into two places:

These can get out of sync when client code mutates the Style, e.g.:

In each of these cases, we have to work around the possibility that when the Style is updated, we could have one or more render cycles where some Tiles are stale, carrying Bucket state that corresponds to the pre-updated style layers.

jfirebaugh commented 6 years ago

I'm marking #3949 and #3453 as duplicates of this issue, since this issue states the problem most generally, but note that those other issues have good discussion of specific aspects of this problem.

anandthakker commented 6 years ago

In https://github.com/mapbox/mapbox-gl-js/issues/3453, @ansis suggests that we should aim for solution wherein all tiles being rendered have been laid out using the same view of the style.

If want to do that -- and even if we don't -- I think https://github.com/mapbox/mapbox-gl-js/issues/4875 will make this much more tractable. Once we have an immutable Style object, having each Tile hold a reference to the Style with which it was created will be pretty straightforward.