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: eagerly listen to TileLayer.reset stream to ensure handler is fired #1943

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

JaffaKetchup
Copy link
Member

Also added refreshing of reset listener when reset stream changes within widget lifecycle.

Fixes #1808. However, the behaviour is still not correct, because the tile loading logic is incorrect. This looks like #1813:

  • If the urlTemplate does not change, tiles are evicted but not loaded until the map is moved (and possibly the tiles are not evicted correctly because they appear to reload quickly, so maybe from cache, but reset should empty cache)
  • If the urlTemplate does change, tiles are evicted but then instantly reloaded (see above), and new tiles load in gradually replacing/overlaying the old ones - the old tiles should not become visible in-between

Therefore, this will need a follow up PR.

Added refreshing of reset listener when reset stream changes within widget lifecycle
Copy link
Contributor

@josxha josxha left a comment

Choose a reason for hiding this comment

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

Nice pull request @JaffaKetchup!👍Added two small comments.
Could be nice to have a test for this, but no pressure. 😄

lib/src/layer/tile_layer/tile_layer.dart Show resolved Hide resolved
lib/src/layer/tile_layer/tile_layer.dart Show resolved Hide resolved
@JaffaKetchup
Copy link
Member Author

We can add a more detailed test for the pruning etc. logic when #1813 is fixed.

Copy link
Contributor

@josxha josxha left a comment

Choose a reason for hiding this comment

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

👍

@JaffaKetchup JaffaKetchup merged commit bf91ee0 into master Sep 28, 2024
9 checks passed
@JaffaKetchup JaffaKetchup deleted the fix-reset-listener branch September 28, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] TileLayer.reset internal listener never triggers
2 participants