urbica / react-map-gl

React Component Library for Mapbox GL JS
https://urbica.github.io/react-map-gl/
MIT License
416 stars 50 forks source link

More than 16 maps on a page // Callback if browser invalidates WebGL context #526

Open derwaldgeist opened 1 year ago

derwaldgeist commented 1 year ago

Feature Request:

We're building an app for experiences in multiple cities, which is why we wanted to have multiple maps on one web page. When we added more than 16, suddenly the first maps disappeared. We learned that there is a browser restriction (in Chrome and Firefox) that a maximum of 16 WebGL contexts can be used.

https://stackoverflow.com/questions/50684887/is-there-any-maps-per-page-limitation-in-mapbox-gl

https://stackoverflow.com/questions/33800600/error-webgl-exceeded-16-live-webgl-contexts-for-this-principal-losing-the-lea

It seems as if Mapbox GL throws and error in this case, but Urbica Maps won't. Is there maybe a way to catch this via an error callback?