Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fastReplace option to TileLayerOptions. #781

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

pento
Copy link
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
Collaborator

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
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

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.

@pento
Copy link
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

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
Copy link
Contributor Author

pento commented Apr 21, 2021

Okay stalebot.

@github-actions github-actions bot removed the Stale label Apr 22, 2021
Copy link
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
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