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

Don't delete and then recreate map markers for each change #43

Open
rod-glover opened this issue Nov 14, 2017 · 0 comments
Open

Don't delete and then recreate map markers for each change #43

rod-glover opened this issue Nov 14, 2017 · 0 comments

Comments

@rod-glover
Copy link
Contributor

CAUTION: Do not embark on this optimization without profiling evidence that shows it is actually an issue.

Currently, when there is any change to the props that determine what data is displayed (variable, dataset, month, year), the baseline and monthly data arrays are emptied, then filled again with new values. This may inhibit React from rendering these changes efficiently.

The goal is to remove the data markers from the map while data is loading. This can be done alternatively by hiding the relevant Layer Groups, a much faster operation. This would improve performance if the markers themselves can be reused. It's not clear whether React has any influence on the Leaflet rendering of the markers, but it's possible. It's also possible that updating existing markers in Leaflet may be considerably faster than deleting and recreating them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant