Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Style source reload error on browser tab change #2926
Observed with version 0.21.0 or latest master
I have a web socket streaming in events multiple per second. Each event is added to the map as a point icon for 2 seconds using its own source and layer. All is good until I change browser tabs, then I observe that the map stops re-rendering (to be efficient I assume) and the style update queue starts filling. When I switch back to the map tab, the style update resumes and batch processes the queue (with all of the source adds/removes), and I get a source reload error.
I didn't have this error with version 0.15.0, prior to the refactoring of batch processing.
You should see contour sources and layers getting added and removed in quick succession. Now change tabs for at least a few seconds and then change back. Observe the console error Cannot read property 'reload' of undefined. After that the map is in a broken state and you'll need to refresh.
Pull request forthcoming that I think resolves the issue. Comments welcome, thanks.