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: avoid layer reloads and redrawing the map #2532

Merged
merged 7 commits into from
Mar 16, 2023
Merged

Conversation

turban
Copy link
Contributor

@turban turban commented Mar 15, 2023

This PR fixes issues to avoid expensive reloads of map layers and map redraws:

  • System setting keyDefaultBaseMap is not always available when we first load/render a map. We wait for the value before we fetch the map (so we don't trigger the fetch twice).
  • If a map has more than one layer, and one layer finishes loading before the other, the new load is triggered for the unloaded layers. This PR adds a new isLoading prop to the layer config. If true it will not trigger a new load of the layer.

After this PR the thematic loaded is only triggered once for a map with two thematic layers:
Screenshot 2023-03-15 at 17 30 40

Before the thematic loaded was triggered 5 times (3 is not needed):
Screenshot 2023-03-15 at 17 32 15

@turban turban changed the title fix: avoid redrawing the map and layer reloads fix: avoid layer reloads and redrawing the map Mar 15, 2023
@cypress
Copy link

cypress bot commented Mar 15, 2023

Passing run #1870 ↗︎

0 33 20 0 Flakiness 0

Details:

fix: avoid interpretation map redraws (#2531)
Project: maps Commit: d5449f5761
Status: Passed Duration: 04:23 💡
Started: Mar 16, 2023 9:35 AM Ended: Mar 16, 2023 9:40 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@turban turban requested a review from jenniferarnesen March 15, 2023 16:28
@turban turban merged commit 2c4e254 into master Mar 16, 2023
@turban turban deleted the fix/avoid-map-rerender branch March 16, 2023 09:46
dhis2-bot added a commit that referenced this pull request Mar 16, 2023
## [1.30.15](v1.30.14...v1.30.15) (2023-03-16)

### Bug Fixes

* avoid layer reloads and redrawing the map ([#2532](#2532)) ([2c4e254](2c4e254))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.30.15 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants