-
Notifications
You must be signed in to change notification settings - Fork 799
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
do not clear _currentSnapshot when hiding the layer #1212
Conversation
🤷 nobody has touched that code in 5 years. off the top of my head it doesn't seem problematic to preserve the cache instead of destroying it in the block. the only other thing i'd suggest testing would be applying a new filter both while the layer is at a visible zoom level and when its not. i have a very vague recollection of folks complaining about a stale cache in a scenario like that. |
second param should be an object, not a string.
Thanks @jgravois - you were correct there was an issue when zooming in, calling Seems like in (note this might address the issues from #665) |
@gavinr this looks like a good change. Lets merge this. |
thanks Patrick. @jwasilgeo found one small issue - i'm going to try to fix that quickly before merge. |
@gavinr, I'd like to also add the Labeling Features demo page to our list of manual tests. The odd behavior described in #1193 was fixed as a byproduct of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great. Thanks for diving into this one and fixing it, @gavinr.
do not clear _currentSnapshot when hiding the layer
do not clear _currentSnapshot when hiding the layer
The behavior in #1207 is happening because the first time the layer is hidden due to the maxZoom,
this._currentSnapshot
is emptied, so the next time it tries to hide the layers,this._currentSnapshot
is empty so it does not remove anything.The bug is fixed if you remove that line (this PR), but I'm not quite convinced this is the correct fix because I'm guessing there's some side-effect that requires that line, and I'm just not understanding it - @patrickarlt @jgravois please let me know if you have any insights into why this line (
this._currentSnapshot = [];
) was originally included.