Open coogle opened 9 months ago
As far as I know, the tile layer checks if tiles need to be purged or loaded when a MapEventWithMove
is emitted. move, rotate and so on all trigger a child object of this event and therefore update the tiles.
I'm sorry but I'm not sure if I can reproduce your described problem with your code snipped.
However in the example app if you trigger a second animation before the first has ended, the tiles won't be loaded. Could this be related to your described issue?
https://github.com/fleaflet/flutter_map/assets/34318751/cc5e9800-cf69-43bd-85e8-5a4bc1b5936a
You can try it out yourself on https://demo.fleaflet.dev/map_controller_animated
That's actually exactly what I am experiencing.. but I'm not sure how I'd be calling the animation twice! Seeing as this is in the demo, does that mean there isn't really a fix available?
If both has the same cause it's probably the best to check in your app if any animations is going on before starting a second animation. I'm still not sure why exactly this bug occurs, my guess would be somewhere in the tile manager.
I'm sorry to say but I don't think that there will be an fix any time soon because all resources are currently on performance tweaks and gestures. However we are happy to accept pull requests if you find the time to investigate. (:
@coogle Btw you could try the flutter_map_animations plugin. It's written by a flutter_map maintainer. Maybe the problem doesn't occur when using it.
I'll check out the plugin, thanks for the suggestion! I agree it's def. related to the Tiles specifically because in my situation I have multiple custom layers which render just fine post-animation.. it's only the tile layers that break. If I happen to figure out what's wrong I'll throw up a PR but I'm under a gun right now so it's more likely I'll just skip the animation for now until I get some more breathing room.
There's some similarities to #1808's broken fix. I bet if that issue is fixed (tiles not loading after prune), this issue will be fixed as well.
I am using flutter_map_animations and I am having the exact same issue.
I have the same as in the https://github.com/fleaflet/flutter_map/issues/1813#issue-2103948335 and https://github.com/fleaflet/flutter_map/issues/1813#issuecomment-1913562337, after I call MapController.move
then I see no tiles, only after making a gesture on the map the tiles do load. Flutter 3.19.5, both iOS and Android.
My workaround as I'm also using the flutter_map_animations
is using the AnimatedMapController.animateTo
with zero duration.
Although this bug occurs rarely, I have assigned P1, as fixing this may help to fix a number of other bugs.
When #1943 is merged, this issue will still prevent proper functioning of reset
.
What is the bug?
I'm not sure what exactly to report as the bug, but I have a situation where I am using an animation to move my map programmatically using the following code. The animation works pretty well, but at the end of the animation I end up with a totally gray map until I interact with it again (e.g. slightly zoom out or move the map by dragging).
All of the other layers render except the tile layer. I'm not seeing any network traffic downloading the tiles, but that said when the map does render after manual intervention it loads instantly (so it already had the tiles).
How can we reproduce it?
See provided animation controller which moves a map.
Do you have a potential solution?
As a workaround, or perhaps to fix a bug in my code because I missed something, I'm trying to figure out how to trigger whatever is happening when I manually interact with the map after moving to my destination to actually redraw it. Notably, I've tried ending the animation with one last move ... including on a slight delay .. to no effect.
Platforms
Flutter Web
Severity
Minimum: Allows normal functioning