Closed weiweiMT closed 1 month ago
Hi @weiweiMT,
Thanks for reporting! I can reproduce this by adding a print
statement (rather than a breakpoint) inside the reset
stream listener.
Before we look into fixing this, can I ask why this is required? Changing the URL should now work without using the reset stream (unlike in previous versions) - is there some sort of improper caching you're trying to invalidate? I'm just thinking it might be worth looking into removing it if there are better alternatives.
@JaffaKetchup Thank you for your help! Thank you for looking into this! The reason we rely on the reset functionality is to make the TileLayer re-fetch the sonar raster data from GeoServer WMS. Since the URL remains constant, the TileLayer won't update on its own. However, for sonar data, we require real-time updates. The reset mechanism is crucial for ensuring the timely refresh of the TileLayer in our application. Appreciate your support!
I've fixed the issue of the listener never firing, but it looks as though the issue from #1619/#1620 has returned, but that fix doesn't resolve the issue now. There's also some similarities to #1813.
I think a fix in the TileImageManager
is required.
What is the bug?
I was trying to use reset to trigger reload one of my TileLayer, but I found that the subsciption of reset never be initialized. In lib/src/layer/tile_layer.dart, the subscription of reset dosen't be triggered properly:
Because keyword "late" was used for _resetSub, and it never be accessed which means it will not be initialized. I tried to add one line "print(_resetSub);", then this subscription works. I think that might be bug.
How can we reproduce it?
TileLayer
in your Flutter application.reset
stream for theTileLayer
, exactly same logic with the flutter map demo app.Do you have a potential solution?
Access it somewhere might be able to solve this problem.
Platforms
macOS, web
Severity
Minimum: Allows normal functioning