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
Observe TileLayerOptions changes #584
Observe TileLayerOptions changes #584
Conversation
Old tiles can be overwritten too with new ones without reload see #583. |
@johnpryan - I think this PR should be prioritized, together with #577. It solves some real problems that blocks actual usage in the wild. We are using flutter_map in an open source app for search and rescue, which demands good behavior when network conditions are poor. These PRs resolves some long-standing issues for us. @maRci002 - this is awesome work, thanks! |
@maRci002 - I think there are some additional use-cases to cover, which I'm currently looking into. Most importantly; tracking connectivity changes from offline to online. Currently, there is no way of externally forcing a invalidation of tiles with |
@kengu this PR is ready to merge. #577 is still under development however you are right |
Yes, that my line of thinking also. Did a quick test locally using the same approach as you have in this PR. Just adding a "offline" member to the options and checking if it is changed and false, which evicts all error tiles works like a charm when combined with the connectivity pacakge. Working example: https://github.com/DISCOOS/flutter_map/blob/track_change_and_evict_errors/lib/src/layer/tile_layer.dart#L392 |
Connectivity package will trigger even if you just connect to router but it may not has connection to internet. If you just play with
|
@maRci002 - that's right. I'm actually using I see that for Although, the impact of not setting |
@maRci002 Could you please provide the source code of your example above. I find it very interesting. |
@S-Man42 I don't have the example code but it ist just a However since #585 needs this PR I made there an example just register your |
That works for me very well! Great! Unfortunately I cannot use in my app currently, because I am using the Marker Popup Plugin which depends on flutter_map 1.4.0 and has problems with your git commit checkout. We need to get this merged! |
Any chance to merge it? Same issue as for @S-Man42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found no problems with the code.
Checked out - worked as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I have no write access.
@@ -952,11 +1034,14 @@ class Tile implements Comparable<Tile> { | |||
_imageStream?.removeListener(_listener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to dispose the animation controller, that was a reason for crash
_imageStream?.removeListener(_listener); | |
animationController?.dispose(); | |
_imageStream?.removeListener(_listener); |
I used this commit for about month and found that we need also to dispose Animation Controller |
Any chance of merging this? Having the option to reset/reload the tiles is pretty essential in my opinion. |
Please we need one additional approval. Could anyone have a look at this PR? |
@maRci002 please approve the proposed change |
Hello, this PR adds support for detecting URL changes / tileSize changes / updateInterval changes and reloads Tiles if necessary.
closes #583