diff options
Diffstat (limited to 'src/mbgl/style/style_impl.cpp')
-rw-r--r-- | src/mbgl/style/style_impl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index 5c9edc789f..236aa4d3aa 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -21,6 +21,8 @@ #include <mbgl/storage/file_source.hpp> #include <mbgl/storage/resource.hpp> #include <mbgl/storage/response.hpp> +#include <mbgl/util/feature_state.hpp> +#include <mbgl/style/sources/geojson_source.hpp> namespace mbgl { namespace style { @@ -357,5 +359,19 @@ Immutable<std::vector<Immutable<Layer::Impl>>> Style::Impl::getLayerImpls() cons return layers.getImpls(); } +Immutable<std::unordered_map<std::string, Immutable<std::vector<FeatureStateChange>>>> Style::Impl::getFeatureStateChangeSets() { + auto sources_ = getSources(); + Mutable<std::unordered_map<std::string, Immutable<std::vector<FeatureStateChange>>>> + collectedStates(makeMutable<std::unordered_map<std::string, Immutable<std::vector<FeatureStateChange>>>>()); + + for (auto src: sources_) { + if (src->is<GeoJSONSource>()) { + GeoJSONSource * gjSrc = src->as<GeoJSONSource>(); + collectedStates->insert({gjSrc->getID(), gjSrc->collectFeatureStates()}); + } + } + return std::move(collectedStates); +} + } // namespace style } // namespace mbgl |