diff --git a/mapbox-gl-js b/mapbox-gl-js index e3b2df280..1bc8caa7c 160000 --- a/mapbox-gl-js +++ b/mapbox-gl-js @@ -1 +1 @@ -Subproject commit e3b2df28079f350747db177e0707698847d0bcd1 +Subproject commit 1bc8caa7c647d89200b974374b4476cef937aa0c diff --git a/src/mbgl/style/source_impl.hpp b/src/mbgl/style/source_impl.hpp index e8ba54b2b..b4473cbc8 100644 --- a/src/mbgl/style/source_impl.hpp +++ b/src/mbgl/style/source_impl.hpp @@ -51,6 +51,9 @@ public: // Removes all tiles (by putting them into the cache). void removeTiles(); + // Remove all tiles and clear the cache. + void invalidateTiles(); + // Request that all loaded tiles re-run the layout operation on the existing source // data with fresh style information. void reloadTiles(); @@ -92,15 +95,14 @@ public: void detach(); protected: - void invalidateTiles(); - void removeStaleTiles(const std::set&); - Source& base; SourceObserver* observer = nullptr; std::map> tiles; TileCache cache; private: + void removeStaleTiles(const std::set&); + // TileObserver implementation. void onTileChanged(Tile&) override; void onTileError(Tile&, std::exception_ptr) override; diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 964098840..4c3ea207f 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -279,6 +279,8 @@ void Style::relayout() { Source* source = getSource(sourceID); if (source && source->baseImpl->enabled) { source->baseImpl->reloadTiles(); + } else if (source) { + source->baseImpl->invalidateTiles(); } } updateBatch.sourceIDs.clear();