diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-03-04 18:44:33 -0800 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2017-03-10 11:08:32 -0800 |
commit | 517659b1b44a4e31e1035d4da9c444380454ad58 (patch) | |
tree | 45777ce2cf3ca4cb4d22ab42c6a82c6b4118b530 /include | |
parent | 4d325879b89323439e9c2955ba5271d03c910490 (diff) | |
download | qtlocation-mapboxgl-517659b1b44a4e31e1035d4da9c444380454ad58.tar.gz |
[core] query source features
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/query.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/style/query.hpp | 24 | ||||
-rw-r--r-- | include/mbgl/style/source.hpp | 5 |
3 files changed, 33 insertions, 1 deletions
diff --git a/include/mbgl/map/query.hpp b/include/mbgl/map/query.hpp index 201484cd84..827424d21d 100644 --- a/include/mbgl/map/query.hpp +++ b/include/mbgl/map/query.hpp @@ -3,6 +3,9 @@ #include <mbgl/util/optional.hpp> #include <mbgl/style/filter.hpp> +#include <string> +#include <vector> + namespace mbgl { /** @@ -12,7 +15,7 @@ class RenderedQueryOptions { public: /** layerIDs to include in the query */ optional<std::vector<std::string>> layerIDs; - + optional<style::Filter> filter; }; diff --git a/include/mbgl/style/query.hpp b/include/mbgl/style/query.hpp new file mode 100644 index 0000000000..8cb2545ab4 --- /dev/null +++ b/include/mbgl/style/query.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include <mbgl/util/optional.hpp> +#include <mbgl/style/filter.hpp> + +#include <string> +#include <vector> + +namespace mbgl { +namespace style { + +/** + * Options for query source features + */ +class SourceQueryOptions { +public: + // Required for VectorSource, ignored for GeoJSONSource + optional<std::vector<std::string>> sourceLayers; + + optional<style::Filter> filter; +}; + +} // namespace style +} // namespace mbgl diff --git a/include/mbgl/style/source.hpp b/include/mbgl/style/source.hpp index 870c81fda6..0901bb1954 100644 --- a/include/mbgl/style/source.hpp +++ b/include/mbgl/style/source.hpp @@ -1,11 +1,14 @@ #pragma once +#include <mbgl/util/feature.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/optional.hpp> #include <mbgl/style/types.hpp> +#include <mbgl/style/query.hpp> #include <memory> #include <string> +#include <vector> namespace mbgl { namespace style { @@ -52,6 +55,8 @@ public: std::unique_ptr<Source> copy(const std::string& id) const; optional<std::string> getAttribution() const; + + std::vector<Feature> querySourceFeatures(const SourceQueryOptions& options = {}); // Private implementation class Impl; |