summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2018-01-04 17:01:49 -0500
committerAnsis Brammanis <ansis@mapbox.com>2018-01-04 17:01:49 -0500
commit29c1f6a1459407c19f6edf971c64d32ca50f706a (patch)
tree9a3a5a8ce7eb92da9ab9c0b98d4bd227b2632324
parentc62b0af24fc76b4bb2eb34100611dd3ee9ee5536 (diff)
downloadqtlocation-mapboxgl-upstream/fix-108333.tar.gz
[core] fix #10833 loading overscaled tilesupstream/fix-108333
This reverts a regression in ed5438fc21672e838947c06669dd44051ce24c81 which set `tileZoom = idealZoom` for all types of tiles. The second change makes it so that panTiles get loaded only if they have a lower *data zoom* (only if they cover a larger area).
-rw-r--r--src/mbgl/renderer/tile_pyramid.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp
index 870d9050bc..6a711fb6d5 100644
--- a/src/mbgl/renderer/tile_pyramid.cpp
+++ b/src/mbgl/renderer/tile_pyramid.cpp
@@ -93,17 +93,21 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
if (overscaledZoom >= zoomRange.min) {
int32_t idealZoom = std::min<int32_t>(zoomRange.max, overscaledZoom);
- // Only attempt prefetching in continuous mode.
- if (parameters.mode == MapMode::Continuous) {
+
+ // Make sure we're not reparsing overzoomed raster tiles.
+ if (type == SourceType::Raster) {
tileZoom = idealZoom;
+ }
+ // Only attempt prefetching in continuous mode.
+ if (parameters.mode == MapMode::Continuous) {
// Request lower zoom level tiles (if configured to do so) in an attempt
// to show something on the screen faster at the cost of a little of bandwidth.
if (parameters.prefetchZoomDelta) {
panZoom = std::max<int32_t>(tileZoom - parameters.prefetchZoomDelta, zoomRange.min);
}
- if (panZoom < tileZoom) {
+ if (panZoom < idealZoom) {
panTiles = util::tileCover(parameters.transformState, panZoom);
}
}