summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-02-16 12:38:23 -0800
committerJason Wray <friedbunny@users.noreply.github.com>2018-02-20 14:23:42 -0500
commit054d4d5ad676ce1ca9a740bc99ccd7ff2f9fecec (patch)
treec0b8380e26ff6d7c6431f9d950aad1a94fe074b0 /src/mbgl/renderer
parentc2be33fa4135f3c132f31437cfc0cd759c273790 (diff)
downloadqtlocation-mapboxgl-054d4d5ad676ce1ca9a740bc99ccd7ff2f9fecec.tar.gz
[core] Support a range of zooms in TileRange. Accounts for TilePyramid requesting parent tiles of ideal zoom tiles.
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/tile_pyramid.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp
index c4372e7112..8f83a0f982 100644
--- a/src/mbgl/renderer/tile_pyramid.cpp
+++ b/src/mbgl/renderer/tile_pyramid.cpp
@@ -143,10 +143,13 @@ void TilePyramid::update(const std::vector<Immutable<style::Layer::Impl>>& layer
auto it = tiles.find(tileID);
return it == tiles.end() ? nullptr : it->second.get();
};
-
+
+ // The min and max zoom for TileRange are based on the updateRenderables algorithm.
+ // Tiles are created at the ideal tile zoom or at lower zoom levels. Child
+ // tiles are used from the cache, but not created.
optional<util::TileRange> tileRange = {};
if (bounds) {
- tileRange = util::TileRange::fromLatLngBounds(*bounds, std::min(tileZoom, (int32_t)zoomRange.max));
+ tileRange = util::TileRange::fromLatLngBounds(*bounds, zoomRange.min, std::min(tileZoom, (int32_t)zoomRange.max));
}
auto createTileFn = [&](const OverscaledTileID& tileID) -> Tile* {
if (tileRange && !tileRange->contains(tileID.canonical)) {