summaryrefslogtreecommitdiff
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 16:44:06 -0300
commit8754e7f9325d0834026888d7f780c7272073c782 (patch)
tree7aeb69481f90ed00a076cbbb0186a2954fe09cf3
parent04b6d893b519df07c15fe7c3f2ed294c0e37cb40 (diff)
downloadqtlocation-mapboxgl-upstream/regressions-mapbox-gl-native-9979.tar.gz
[core] Bypass GeoJSON tile data update if tileID zoom is above source's maxZoomupstream/regressions-mapbox-gl-native-9979
m---------mapbox-gl-js0
-rw-r--r--src/mbgl/renderer/sources/render_geojson_source.cpp13
2 files changed, 8 insertions, 5 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject 7d452eafbd8ecc008b6d934e20175f32bc7945b
+Subproject 3634d945477cb7dbbf1e0bebf4cf51542821895
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;
}