Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL Context limits #120

Open
gavinr opened this issue Feb 17, 2022 · 0 comments
Open

WebGL Context limits #120

gavinr opened this issue Feb 17, 2022 · 0 comments

Comments

@gavinr
Copy link
Contributor

gavinr commented Feb 17, 2022

  • Modern web browsers currently have a maximum limit of 16 WebGL contexts in a page.
  • For each layer that is created, Esri Leaflet Vector creates a new instance of Mapbox GL JS, and thus a new WebGL context.

Due to the above two facts, right now there is a limitation that no more that 16 Esri Leaflet Vector layers can be added on a page at one time.

Demo case: 17 vector layers in a single map

I have created 17 separate vector layers, each with a single point in the layer. Example case: https://jsbin.com/ludubaz/2/edit?html,output

  • Expected: 17 points (one for each layer) are visible on the map
  • Actual: 16 points are visible on the map. (due to the fact that the browser can only have 16 WebGL contexts so one of the layers must be destroyed when the 17th is created)

image

Problem Scope

Having more than 16 vector tile layers in a single map may seem unrealistic right now, but as vector tile layers become more popular I think this situation may become more common.

Solution

Right now, every time an Esri Leaflet Vector layer is created, a new Mapbox GL JS instance is created, and thus a new WebGL context is created. Could we slightly modify how this works to somehow have all the layers share one instance of Mapbox GL JS, thus having all the layers share one WebGL context? Would this add limits on how layers can be re-ordered?

@gavinr gavinr changed the title WebGL Contexts limits WebGL Context limits Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant