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

WebGLTileLayer with palette style stops working after map.removeLayer/map.addLayer #15786

Closed
malaretv opened this issue Apr 30, 2024 · 2 comments · Fixed by #15787
Closed

WebGLTileLayer with palette style stops working after map.removeLayer/map.addLayer #15786

malaretv opened this issue Apr 30, 2024 · 2 comments · Fixed by #15787
Labels

Comments

@malaretv
Copy link
Contributor

malaretv commented Apr 30, 2024

Describe the bug
WebGLTileLayers with a style that includes a palette seem to break when removed and added back to map.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/p/sandbox/cog-style-forked-2vg3p9?file=%2Findex.html%3A22%2C68 (A modified cog-style example w/ a button added to addLayer()/removeLayer() from map)
  2. Click 'Add / Remove layer' button multiple times and see there is no problem.
  3. Switch layer style to 'NDVI w/ palette 1'
  4. Click 'Add / Remove layer' button multiple times and see there is now a black layer
  5. Note in console warnings/errors (vary by browser) something along the lines of:
    WebGL warning: bindTexture: tex is from a different (or lost) WebGL context. or WebGL: INVALID_OPERATION: bindTexture: object does not belong to this context

Expected behavior
That the WebGLTileLayer shows with proper style when added back to map

@tschaub
Copy link
Member

tschaub commented Apr 30, 2024

Thanks for the report, @malaretv. I've proposed a fix in #15787.

Hope you're well.

@malaretv
Copy link
Contributor Author

malaretv commented May 2, 2024

Thanks to you @tschaub!! And likewise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants