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

Fix GridLayer occassionally leaving tiles from two layers active #6522

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ij1
Copy link

@ij1 ij1 commented Feb 20, 2019

If GridLayer finds a tile that is not current but is still active, set a flag to do a prune if at the end of the fade.

I suspect the original problem might be due to a race between _updateOpacity and timed prune from _tileReady. As it seems cheap to calculate when a clearing prune is needed at the end of the fade, just do it.

If GridLayer finds a tile that is not current but is still active,
set a flag to do a prune if at the end of the fade.

I suspect the original problem might be due to a race between
_updateOpacity and timed prune from _tileReady. As it seems cheap
to calculate when a clearing prune is needed at the end of the
fade, just do it.
@johnd0e
Copy link
Collaborator

johnd0e commented Apr 18, 2020

I suspect the original problem might be due to [...]

What is mentioned 'original problem'?
Is there some issue reported?

@ij1
Copy link
Author

ij1 commented Apr 22, 2020

I suspect the original problem might be due to [...]

What is mentioned 'original problem'?
Is there some issue reported?

"The original problem" just referred to what's in the title, that is, gridlayer leaves tiles from two different zoom levels active. The one which has a large scale() looks very blurry and mixes with the tiles that are for the currently correct zoom level. To me it looked as if the pruning is somehow timer dependent and failed to do its work if timer fired early enough but I'm no expert on how it is supposed to work.

@johnd0e
Copy link
Collaborator

johnd0e commented May 4, 2020

@ij1

"The original problem" just referred to what's in the title, that is, gridlayer leaves tiles from two different zoom levels active.

Do you have sample code to reproduce original problem?
We need to check if it's gone after #7123 (not sure if it's related without sample code)

@joshuahhh
Copy link

I've run into this problem myself, running Leaflet 1.7.1. It's hard to reproduce – it only happens sometimes, and only in a complex setup using Leaflet.PixiOverlay.

Here's a GIF of the problem, in Leaflet 1.7.1. Labels are on a layer above the background. Note that the first zoom works out ok, but not the second.
map2

I will see if I can merge & test this change.

@joshuahhh
Copy link

I just tested this change by manually editing leaflet-src.js in my node_modules folder. It seems to completely eliminate the problem. If it's necessary, I can try to find a minimal reproduction of the original problem, but, as I mentioned, that may be difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants