Select to view content in your preferred language

LayerList Widget Not Releasing Layer Context

158
1
08-06-2024 06:46 AM
FlockSafety
Emerging Contributor

Hello, I'm working in an app where we have a primary map on the page and a secondary map that is part of a popup. After repeatedly opening and closing the secondary map, eventually the primary map goes blank with an console warning "WebGL context lost".

After some troubleshooting, I learned this was causing by not properly calling the map.destory() and mapView.destroy() methods for garbage collection. However, I noticed that this issue persisted after implementing these methods ONLY if I included the LayerList widget in my maps.

It seems that the LayerList widget is not properly disposing of its layer information and/or webGL contexts to VectorLayers. Our team has a custom layer list implementation that does not encounter this issue.

I wanted to see if the LayerList not properly performing garbage collection is a known issue, or if this is something that needs to be raised to the team.

Tags (2)
0 Kudos
1 Reply
Sage_Wall
Esri Contributor

Thanks for reporting this here @FlockSafety , this is not a know issue.  Could you please provide a reproducible test case with a codepen or some other online sandbox?

You also might need to call LayerList.destroy(), it's not specifically mentioned above.

It also might be best to work with tech support on this one so they can assign it an official bug number. https://support.esri.com/en-us/contact

0 Kudos