Open Eddie-Larsson opened 6 years ago
we are displaying an historical sequence of maps and therefore we need to know when to hide layers (when the new one is fully rendered)... What would be the best way of doing it ? (waiting few times half a second seams a lot...)
@sebastianovide Beats me, the best way I've found is the one described above. If I knew of a better way I'd be using it.
As stated the 'load' event for the rendered map is fired before everything has been properly rendered, resulting in missing features in the image. Current workaround is to listen for the 'render' event and wait in intervals of 500 milliseconds, if no render event happened during that time the map is considered done.
This is undesirable for a multitude of reasons but the primary problem is that the "fix" might fail horribly under some condition such as poor network connectivity or possibly even a slow machine.
Possibly related are the following mapbox-gl -js issues 1, 2.