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

fix: remove old map layers before rendering new layers #194

Merged
merged 2 commits into from
Mar 24, 2024

Conversation

wang-boyu
Copy link
Member

Fix #192

Layers were added to leaflet map at each model step, but were never removed. This resulted in too many layers to be unnecessarily rendered when model kept running (shown below).

Screenshot 2024-03-22 at 11 05 21

This fix removes old layers before new layers are added into leaflet map.

@wang-boyu wang-boyu added the bug Release notes label label Mar 22, 2024
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.21%. Comparing base (b717971) to head (c307dbc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   78.17%   78.21%   +0.03%     
==========================================
  Files          10       10              
  Lines         692      693       +1     
  Branches      151      151              
==========================================
+ Hits          541      542       +1     
  Misses        127      127              
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wang-boyu
Copy link
Member Author

Hi @rht @Corvince @EwoutH not sure whether this is a good time to ask, but would you like to take a look at this PR? Thanks!

@wang-boyu wang-boyu requested review from rht, Corvince and EwoutH March 23, 2024 15:34
Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not too familiar with this part of the code base, but I see nothing weird.

@wang-boyu
Copy link
Member Author

Thanks @EwoutH !

@rht rht merged commit f647e79 into projectmesa:main Mar 24, 2024
11 checks passed
@wang-boyu wang-boyu deleted the fix/map-layers branch March 26, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Control widgets disappear when zooming into rainfall demo
3 participants