summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-30 14:04:36 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-30 16:02:26 +0300
commite1dfdc93383c29b02964456df5cd08ef2635c6d5 (patch)
tree2e63d701fe977ae7b9ddf00e371389ed769e3f76
parent9491527eb6ba320ca0b1bb0f37e0822344141aed (diff)
downloadqtlocation-mapboxgl-e1dfdc93383c29b02964456df5cd08ef2635c6d5.tar.gz
[core] Clear RenderGeoJSONSource tilePyramid if no data is available
-rw-r--r--src/mbgl/renderer/sources/render_geojson_source.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mbgl/renderer/sources/render_geojson_source.cpp b/src/mbgl/renderer/sources/render_geojson_source.cpp
index d6a81e13ca..f7976d7210 100644
--- a/src/mbgl/renderer/sources/render_geojson_source.cpp
+++ b/src/mbgl/renderer/sources/render_geojson_source.cpp
@@ -34,19 +34,24 @@ void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_,
GeoJSONData* data_ = impl().getData();
- if (!data_) {
- return;
- }
-
if (data_ != data) {
data = data_;
tilePyramid.cache.clear();
- for (auto const& item : tilePyramid.tiles) {
- static_cast<GeoJSONTile*>(item.second.get())->updateData(data->getTile(item.first.canonical));
+ if (data) {
+ for (auto const& item : tilePyramid.tiles) {
+ static_cast<GeoJSONTile*>(item.second.get())->updateData(data->getTile(item.first.canonical));
+ }
+ } else {
+ tilePyramid.tiles.clear();
+ tilePyramid.renderTiles.clear();
}
}
+ if (!data) {
+ return;
+ }
+
tilePyramid.update(layers,
needsRendering,
needsRelayout,