ProjectSidewalk / SidewalkWebpage

Project Sidewalk web page
http://projectsidewalk.org
MIT License
80 stars 23 forks source link

LabelMap breaks if you look at too many labels #3512

Closed misaugstad closed 1 month ago

misaugstad commented 3 months ago
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

Then I click on a label and the whole map goes white Screenshot from 2024-03-05 12-35-12 Screenshot from 2024-03-05 12-34-39

And then here are the console messages Screenshot from 2024-03-05 12-59-48

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.

misaugstad commented 1 month ago

Closing via #3549