summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-14 09:41:53 -0400
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-15 18:28:40 -0300
commitc20fdd07dbacdc5dbbba07de63fb953d798af5be (patch)
tree7aeb69481f90ed00a076cbbb0186a2954fe09cf3 /src
parentfe1cf83a284fbb1b4f04a1a56da8a0df24dad456 (diff)
downloadqtlocation-mapboxgl-c20fdd07dbacdc5dbbba07de63fb953d798af5be.tar.gz
[core] Bypass GeoJSON tile data update if tileID zoom is above source's maxZoom
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/sources/render_geojson_source.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mbgl/renderer/sources/render_geojson_source.cpp b/src/mbgl/renderer/sources/render_geojson_source.cpp
index f7976d7210..504db78ea3 100644
--- a/src/mbgl/renderer/sources/render_geojson_source.cpp
+++ b/src/mbgl/renderer/sources/render_geojson_source.cpp
@@ -2,6 +2,7 @@
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/tile/geojson_tile.hpp>
+#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/algorithm/generate_clip_ids.hpp>
#include <mbgl/algorithm/generate_clip_ids_impl.hpp>
@@ -39,16 +40,18 @@ void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_,
tilePyramid.cache.clear();
if (data) {
- for (auto const& item : tilePyramid.tiles) {
- static_cast<GeoJSONTile*>(item.second.get())->updateData(data->getTile(item.first.canonical));
+ const uint8_t maxZ = impl().getZoomRange().max;
+ for (const auto& pair : tilePyramid.tiles) {
+ if (pair.first.canonical.z <= maxZ) {
+ static_cast<GeoJSONTile*>(pair.second.get())->updateData(data->getTile(pair.first.canonical));
+ }
}
- } else {
- tilePyramid.tiles.clear();
- tilePyramid.renderTiles.clear();
}
}
if (!data) {
+ tilePyramid.tiles.clear();
+ tilePyramid.renderTiles.clear();
return;
}