diff options
Diffstat (limited to 'src/mbgl/style/source_impl.cpp')
-rw-r--r-- | src/mbgl/style/source_impl.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mbgl/style/source_impl.cpp b/src/mbgl/style/source_impl.cpp index f83579d0d0..1f8301629f 100644 --- a/src/mbgl/style/source_impl.cpp +++ b/src/mbgl/style/source_impl.cpp @@ -10,6 +10,7 @@ #include <mbgl/util/tile_cover.hpp> #include <mbgl/util/enum.hpp> #include <mbgl/map/query.hpp> +#include <mbgl/style/query.hpp> #include <mbgl/algorithm/update_renderables.hpp> #include <mbgl/algorithm/generate_clip_ids.hpp> @@ -258,6 +259,23 @@ std::unordered_map<std::string, std::vector<Feature>> Source::Impl::queryRendere return result; } +std::vector<Feature> Source::Impl::querySourceFeatures(const SourceQueryOptions& options) { + + // Only VectorSource and GeoJSON source supported + if (type != SourceType::GeoJSON && type != SourceType::Vector) { + Log::Warning(Event::General, "Source type not supported"); + return {}; + } + + std::vector<Feature> result; + + for (const auto& pair : tiles) { + pair.second->querySourceFeatures(result, options); + } + + return result; +} + void Source::Impl::setCacheSize(size_t size) { cache.setSize(size); } |