Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Bypass GeoJSON tile data update if tileID zoom is above source…
Browse files Browse the repository at this point in the history
…'s maxZoom
  • Loading branch information
brunoabinader committed Sep 15, 2017
1 parent fe1cf83 commit c20fdd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mapbox-gl-js
Submodule mapbox-gl-js updated 44 files
+2 −1 .flowconfig
+45 −1 CHANGELOG.md
+13 −10 docs/_data/roadmap.yml
+50 −2 docs/_layouts/default.html
+2 −2 docs/_posts/examples/3400-01-12-mapbox-gl-geocoder.html
+2 −2 docs/_posts/examples/3400-01-16-point-from-geocoder-result.html
+9 −2 docs/_posts/examples/3400-01-30-3d-buildings.html
+126 −0 docs/_posts/examples/3400-02-02-dancing-buildings.html
+1 −1 docs/_theme/index.hbs
+0 −2 flow-typed/point-geometry.js
+2 −0 flow-typed/pointlike.js
+2 −1 flow-typed/style-spec.js
+2 −0 flow-typed/vector-tile.js
+35 −57 flow-typed/window.js
+2 −2 package.json
+1 −1 src/source/geojson_source.js
+2 −8 src/source/raster_tile_source.js
+1 −3 src/source/source_cache.js
+4 −3 src/source/tile.js
+6 −1 src/source/tile_coord.js
+2 −9 src/source/vector_tile_source.js
+4 −0 src/style-spec/CHANGELOG.md
+0 −81 src/style-spec/function/check_subtype.js
+1 −2 src/style-spec/function/compound_expression.js
+1 −2 src/style-spec/function/definitions/match.js
+2 −2 src/style-spec/function/evaluation_context.js
+12 −4 src/style-spec/function/expression.js
+2 −3 src/style-spec/function/parse_expression.js
+40 −1 src/style-spec/function/types.js
+1 −1 src/style-spec/package.json
+7 −0 src/style-spec/reference/v8.json
+3 −3 src/ui/handler/drag_pan.js
+2 −2 src/ui/handler/drag_rotate.js
+3 −2 src/ui/handler/scroll_zoom.js
+5 −5 src/ui/map.js
+1 −1 src/util/browser/web_worker.js
+1 −1 test/integration/render-tests/regressions/mapbox-gl-js#4564/style.json
+ test/integration/render-tests/regressions/mapbox-gl-native#9979/expected.png
+85 −0 test/integration/render-tests/regressions/mapbox-gl-native#9979/style.json
+16 −7 test/unit/source/raster_tile_source.test.js
+32 −4 test/unit/source/source_cache.test.js
+35 −0 test/unit/source/tile.test.js
+16 −7 test/unit/source/vector_tile_source.test.js
+4 −3 yarn.lock
13 changes: 8 additions & 5 deletions src/mbgl/renderer/sources/render_geojson_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit c20fdd0

Please sign in to comment.