CMU-CREATE-Lab / data-visualization-tools

EarthTime, and various data visualization libraries
Other
14 stars 5 forks source link

Layers with 'isFullExtent' constraint cause layers with lower draw order to endlessly request redraws #240

Open pdille opened 2 years ago

pdille commented 2 years ago

e.g. https://earthtime.org/explore#v=23.621,-26.21434,0.717,latLng&t=0&ps=50&l=bdrk,berkeley-earth-temperature-anomaly,country_and_city_labels,land_borders_raster&bt=18500101&et=20170331 (Pause and turn on fps meter to see it still redrawing. And if you turn on verbose draw logging, you'll see requests for "Layer bdrk requests redraw")

Here, bdrk is lower draw order and its draw state never gets set, since code (line 300 of layerDB.ts) assumes to ignore drawing of lower layers in this situation. The situation in question has become apparent due to the optimizations around when to redraw.

To rectify this, if a layer with 'isFullExtent' is present, I think any layers with lower draw order should be ignored earlier on and removed from the visible layers array before it even gets to line 300 of layerDB.ts