Skip to content

Add a fastReplace option to TileLayerOptions.#781

Merged
kengu merged 2 commits intofleaflet:masterfrom
pento:try/fast-tile-replace
Apr 30, 2021
Merged

Add a fastReplace option to TileLayerOptions.#781
kengu merged 2 commits intofleaflet:masterfrom
pento:try/fast-tile-replace

Conversation

@pento
Copy link
Copy Markdown
Contributor

@pento pento commented Nov 29, 2020

Based on this comment, this PR adds a fastReplace option to TileLayerOptions.

The purpose of this option is to force tiles to be removed as soon as their replacement tile is ready, skipping tileFadeIn* options, as well as the hardcoded delay in _tileReady().

Screenshots

These screenshots are based on this config: the top layer (the place names) uses transparent tiles.

Before

Note how different zoom levels of the top layer are visible at the same time while zooming.

After

It no longer shows multiple zoom levels at the same time, though there is sometimes a small flicker where no tile is visible at all, even after the tiles have been cached. I'm happy to make adjustments if there's a way to avoid this, but otherwise, I think this is an improvement.

@ibrierley
Copy link
Copy Markdown
Contributor

Haven't had chance to test yet, but my main test would be how it acts on pinch/zoom. The old flutter_map flickered a lot due to the problem, so I think it may be a step back if that is impacted, but there again, if it's just an option and clearly marked that it may cause flicker, I guess it feels ok.

I did some testing with this stuff a while back and it felt like you had to have at least one of..
Fading old image in.
Displaying old image and having 2 overlayed for a very short period.
A possible flash during transition.

@pento
Copy link
Copy Markdown
Contributor Author

pento commented Nov 29, 2020

Thanks for the feedback, @ibrierley! You're right, there is noticeable flickering when using pinch-to-zoom, particuarly when the layer is not yet cached: the GIF below shows this when zooming in, then the flickering does become less noticeable when zooming back out again.

I've updated the option documentation to note this caveat.

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Mar 21, 2021
@pento pento force-pushed the try/fast-tile-replace branch from 55a1c71 to 5f857e1 Compare March 22, 2021 01:19
@pento
Copy link
Copy Markdown
Contributor Author

pento commented Mar 22, 2021

I've rebased this PR, I'm still using this change in my own fork, but I'd love if it could be merged here, instead. 🙂

@github-actions github-actions Bot removed the Stale label Mar 22, 2021
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Apr 21, 2021
@pento pento force-pushed the try/fast-tile-replace branch from 5f857e1 to f7b064c Compare April 21, 2021 03:32
@pento
Copy link
Copy Markdown
Contributor Author

pento commented Apr 21, 2021

Okay stalebot.

@github-actions github-actions Bot removed the Stale label Apr 22, 2021
Copy link
Copy Markdown
Contributor

@kengu kengu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kengu kengu merged commit 38d9047 into fleaflet:master Apr 30, 2021
@kengu
Copy link
Copy Markdown
Contributor

kengu commented Apr 30, 2021

@pento Thanks for the contribution!

@pento pento deleted the try/fast-tile-replace branch May 1, 2021 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants