fix bug causing overzoomed tiles to disappear #4567
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4564
For overzoomed tiles,
TileCoord#cover
returns TileCoords with incorrectz
, so they dont appear to be withinTileJSON.bounds
for vector sources with that property, and thus (as of #4556 ) the SourceCache doesn't consider them part ofvisibleCoords
(they get filtered out here) and so the source disappears if it's over itsmaxzoom
For instance in the case of the test case provided in #4564, the source has a
maxzoom
of 11, and the tiles within its bounds are [11/583/782
,11/584/782
,11/583/783
,11/584/784
] but when you zoom to ZL 12,transform.coveringTiles
returns [12/583/782
,12/584/782
,12/583/783
,12/584/784
] which are not the correct tiles, and I guess doesn't cause problems besides this? Or maybe it's like this for a reason?This PR doesn't fix that bc I'm scared to change
TileCoord
without understanding what's going on there. If the behavior ofTileCoord
is indeed a bug I can modify this PR to fix that. This PR is just a workaround to prevent over-zoomed vector sources withbounds
from disappearing.@anandthakker @jfirebaugh
Launch Checklist