woheller69 / omweather

GNU General Public License v3.0
331 stars 14 forks source link

Rain radar heavily flickering when zooming in our out #87

Closed provokateurin closed 1 month ago

provokateurin commented 1 month ago

Describe the bug When zooming in our out on the rain radar there is heavy flickering because all tiles are constantly reloaded. This is very unpleasant to use.

How to Reproduce Steps to reproduce the behavior:

  1. Go to rain radar
  2. Zoom in our out

Expected behavior No flickering, tiles should be cached.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

woheller69 commented 1 month ago

But that cannot be changed because tiles with different sizes have to be loaded

provokateurin commented 1 month ago

Sure, but when I zoom out and then back it, it should load the same tiles as before, no?

woheller69 commented 1 month ago

Yes, and they are loaded from cache. But there are several layers for map, clouds, radar which require some processing. Using Leaflet library. https://github.com/Leaflet/Leaflet

provokateurin commented 1 month ago

So this would only be fixable inside leaflet?

woheller69 commented 1 month ago

same with latest Leaflet library. Maybe some day I will rewrite using osmdroid instead of leaflet. Seems to work much better.

woheller69 commented 1 month ago

For future use: //Example for RainViewer radar overlay final MapTileProviderBasic RainViewerTileProvider = new MapTileProviderBasic(context); final ITileSource RainViewerTileSource = new XYTileSource("RainViewer", 1, 16, 256, "/2/1_1.png", new String[]{"https://tilecache.rainviewer.com/v2/radar/1721157000/256/"}); RainViewerTileProvider.setTileSource(RainViewerTileSource); final TilesOverlay RainviewerTilesOverlay = new TilesOverlay(RainViewerTileProvider, context); RainviewerTilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT); holder.map.getOverlays().add(RainviewerTilesOverlay);

woheller69 commented 1 month ago

Here is a version using Osmdroid. Zooming is better, but now there is a flickering when animating the radar which is not great either. If someone has an idea to fix, let me know. (see also https://github.com/osmdroid/osmdroid/issues/2026)

-Uninstall -Remove .zip and install app-release.apk.zip

woheller69 commented 1 month ago

Got it working without flickering. Ready to test. app-release.apk.zip

-Uninstall -Remove .zip and install

provokateurin commented 1 month ago

Just tried it, works perfectly! Thank you so much :heart: