Revert tile loading changes from #11988 #12075
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 #12069
Reopens https://github.com/mapbox/gl-js-team/issues/443 #1
EDIT2: I've updated this PR to revert the changes in #11988. The new test remains to verify that we're not introducing a regression, while I've added the old test to ignores. I'm working on a more robust and performant solution to that issue to be included in the following release.
This issue: When a tile in globe-to-mercator transition is placed such that the bottom tile corners are just above the view, but the bottom edge of the tile intersects with the view (this is especially possible at extreme lattitudes due to the increasingly curved latitude lines/tile boundaries), the tile is not rendered.
Logic to handle this in Globe by calculating the bounding box of the arc was introduced in #11508. This bug was introduced by an and an attempt to support this in the transition in #11988 (ported from https://github.com/mapbox/mapbox-gl-native-internal/pull/3450) by interpolating the arc extremum toward the midpoint of the corresponding edge in Mercator.
The issue is probably that the arc extremum is always interpolated toward the center of the tile edge. The extreme values of the arc only correspond with the center in the case that a tile edge is centered in the viewport.As the logic is the same in @mapbox/gl-native, this issue likely occurs there too.This can be fixed by taking the maximum values between the Mercator midpoint and arc extremums instead of averaging the two.EDIT: #11988 is actually not working as intended by using interpolated tile corners to generate the AABB. Correcting this results in inadequate tile coverage, likely from an issue of mismatched units (possibly related to the changes to
pixelSpaceConversion
/_transform._pixelsPerMercatorPixel
in #11951, which has not yet been ported to Native.)Previous behavior on left, behavior after fix on right:
@mapbox/gl-native
if this PR includes shader changes or needs a native port