summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-03-04 18:44:33 -0800
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-03-09 13:11:23 -0800
commit0d10d2df1c6d246004e7291511f3aab7a8781d59 (patch)
tree3667c583d44c5237380ad7b79498787caa24a322 /include/mbgl/style
parent548675a196f9e55d87cf8fce837b6e60393cb1b9 (diff)
downloadqtlocation-mapboxgl-0d10d2df1c6d246004e7291511f3aab7a8781d59.tar.gz
[core] query source features
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/query.hpp24
-rw-r--r--include/mbgl/style/source.hpp5
2 files changed, 29 insertions, 0 deletions
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;