diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 4ce701430..cd280d024 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -29,7 +29,6 @@ class LayerDescription; class Sprite; class Style; class StyleLayer; -class StyleLayerGroup; class StyleSource; class TexturePool; class FileSource; @@ -188,7 +187,6 @@ private: void updateTiles(); void updateSources(); - void updateSources(const util::ptr &group); // Triggered by triggerUpdate(); void update(); diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 255d7f8a3..c4ad6efc5 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -723,7 +722,11 @@ void Map::updateSources() { // Then, reenable all of those that we actually use when drawing this layer. if (style) { - updateSources(style->layers); + for (const auto& layer : style->layers) { + if (layer->bucket && layer->bucket->style_source) { + (*activeSources.emplace(layer->bucket->style_source).first)->enabled = true; + } + } } // Then, construct or destroy the actual source object, depending on enabled state. @@ -744,20 +747,6 @@ void Map::updateSources() { }); } -void Map::updateSources(const util::ptr &group) { - assert(Environment::currentlyOn(ThreadType::Map)); - if (!group) { - return; - } - for (const auto& layer : group->layers) { - if (!layer) continue; - if (layer->bucket && layer->bucket->style_source) { - (*activeSources.emplace(layer->bucket->style_source).first)->enabled = true; - } - - } -} - void Map::updateTiles() { assert(Environment::currentlyOn(ThreadType::Map)); for (const auto& source : activeSources) { @@ -807,7 +796,7 @@ void Map::loadStyleJSON(const std::string& json, const std::string& base) { style = std::make_shared