When using LabelMap (or the Admin User dashboard), you can click on a label to open up a GSV view of it. If I do that 10-20 times, even with the same label, the whole map ends up turning white and becomes mostly unresponsive.
Here's what it looks like before anything goes wrong:
Then I click on a label and the whole map goes white
And then here are the console messages
We get these warning when opening these windows on our Label Search page, but we don't need the old WebGL contexts, so it's not a problem! Turns out that Mapbox GL JS uses WebGL (shocker!), so it's now a problem.
Potential solution(s)
I recall in the past noticing that it's difficult to remove/destroy the popup that we're using from bootstrap to display this info. It's weirdly being kept in the DOM somewhere... I think it might be an option to find what's being left over in the DOM and deleting it, it just didn't seem worth the trouble in the past.
An alternative would be to try and remove the popup and just switch out the data. Would require quite a bit of reworking of this code (which is pretty ugly to begin with).
Another option is starting from scratch and rewriting these popups with something better suited to the task.
Brief description of problem/feature
When using LabelMap (or the Admin User dashboard), you can click on a label to open up a GSV view of it. If I do that 10-20 times, even with the same label, the whole map ends up turning white and becomes mostly unresponsive.
Here's what it looks like before anything goes wrong:![Screenshot from 2024-03-05 12-33-40](https://github.com/ProjectSidewalk/SidewalkWebpage/assets/6518824/77c917db-744e-4aae-97e6-f41c4bcecd4e)
Then I click on a label and the whole map goes white
![Screenshot from 2024-03-05 12-34-39](https://github.com/ProjectSidewalk/SidewalkWebpage/assets/6518824/334b412c-2205-42ee-ab3f-10f0c7e4a005)
And then here are the console messages![Screenshot from 2024-03-05 12-59-48](https://github.com/ProjectSidewalk/SidewalkWebpage/assets/6518824/41cf383c-d102-41e9-80d8-de251ab480e4)
We get these warning when opening these windows on our Label Search page, but we don't need the old WebGL contexts, so it's not a problem! Turns out that Mapbox GL JS uses WebGL (shocker!), so it's now a problem.
Potential solution(s)
I recall in the past noticing that it's difficult to remove/destroy the popup that we're using from bootstrap to display this info. It's weirdly being kept in the DOM somewhere... I think it might be an option to find what's being left over in the DOM and deleting it, it just didn't seem worth the trouble in the past.
An alternative would be to try and remove the popup and just switch out the data. Would require quite a bit of reworking of this code (which is pretty ugly to begin with).
Another option is starting from scratch and rewriting these popups with something better suited to the task.