summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/query.hpp5
-rw-r--r--include/mbgl/style/query.hpp24
-rw-r--r--include/mbgl/style/source.hpp5
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;