-
Notifications
You must be signed in to change notification settings - Fork 4
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
Web app memory leak #48
Comments
Thanks for diagnosing this and confirming the issue. If only there were a Rust crate that could do the interactive web mapping thing and not rely on JS... |
There's probably some workaround for Leaflet; I just haven't found it, and because of my unfamiliarity with JS/the browser, I'm lacking the experience to easily dive into this. I'm confident it's solveable.
The point of the web app is to use standard libraries like Leaflet, not reinvent something new! What's awesome is how easy it's been to glue the two approaches together. |
zonebuilder-rust/web/index.html Line 72 in 036add6
I think the problem is here -- we're cleaning up the main geojson layer, but not all of the markers we create for tooltips for each zone label! I'm still wrapping my head around the Leaflet memory model. When you add something to the map, I'm unclear who's supposed to own and clean it up. I think layer groups (https://leafletjs.com/examples/layers-control/) are meant to manage this. Will experiment. |
…aw zone labels checked in, and it was creating a bunch of markers without ever cleaning them up. I'm covered in shame. #48
Very dumb error on my part -- those markers were my attempt to draw permanent labels in the zones, instead of just tooltips. I never figured out the permanent labels, but I didn't clean up the experimental code. It was creating markers and never cleaning them up. The leak is now fixed, but now it reveals that the new search bar doesn't quite work. I'll get that fixed, or reopen the issue to keep tracking it. |
Thanks Dustin! |
Robin reported that the browser tab slows down quickly after dragging the marker around. Confirmed with Firefox's
about:performance
page.zonebuilder-rust/web/index.html
Line 88 in 036add6
addTo(map)
.I miss Rust already. :(
The text was updated successfully, but these errors were encountered: