MapCompose: redrawTiles() sometimes clears the map and does not redraw tiles

I am currently investigating an issue where redrawTiles() sometimes does not trigger a redraw, only clears the map.

In a successful redraw, visibleTilesFlow gets set to null, that gets collected, then to the new VisibleTiles, which gets collected and redrawn. Sometimes, visibleTilesFlow gets sets to null, and then VisibleTiles, as normal, but neither are collected. For some reason the visibleTilesFlow emissions are ignored by the collector. I am still investigating why, but maybe you have an idea.

This only seems to happen when redrawTiles() is called quickly after a previous call, maybe up to 2 seconds. It may just be that it can only happen when the tiles are still loading when another redrawTiles() call is made.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 46 (27 by maintainers)

Commits related to this issue

Most upvoted comments

I’m back porting this inside the layer branch!

I updated the PR, can you take a look? Now duplicate emissions are ignored as they were, but the null cannot be lost as it can with StateFlow.

It’s most probably because tileCanvasState flow receives the same VisibleTiles object it already received the last time redrawTiles was invoked. That should be easy to fix. Thanks.