summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheemm@gmail.com>2017-02-21 18:34:45 -0800
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-03-04 15:42:07 -0800
commit60d10dd27df38ac4e97214d1cd514198c381695c (patch)
treef4ce0ecbf3a7eeb5c19f994d02152fc624b458d9 /include/mbgl/map
parentac4e13416a36905b35401fc1a982c680ca37a3d0 (diff)
downloadqtlocation-mapboxgl-60d10dd27df38ac4e97214d1cd514198c381695c.tar.gz
[core] Add support for queryRenderedFeatures filter
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/map.hpp8
-rw-r--r--include/mbgl/map/query.hpp19
2 files changed, 23 insertions, 4 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 95a82ebd74..7e4eeb8d5b 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -10,6 +10,7 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/style/transition_options.hpp>
#include <mbgl/map/camera.hpp>
+#include <mbgl/map/query.hpp>
#include <cstdint>
#include <string>
@@ -24,8 +25,6 @@ class View;
class FileSource;
class Scheduler;
class SpriteImage;
-struct CameraOptions;
-struct AnimationOptions;
namespace style {
class Source;
@@ -183,8 +182,9 @@ public:
double getDefaultPitch() const;
// Feature queries
- std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const optional<std::vector<std::string>>& layerIDs = {});
- std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const optional<std::vector<std::string>>& layerIDs = {});
+ std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const QueryOptions& options = {});
+ std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const QueryOptions& options = {});
+
AnnotationIDs queryPointAnnotations(const ScreenBox&);
// Memory
diff --git a/include/mbgl/map/query.hpp b/include/mbgl/map/query.hpp
new file mode 100644
index 0000000000..e864dbaa67
--- /dev/null
+++ b/include/mbgl/map/query.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <mbgl/util/optional.hpp>
+#include <mbgl/style/filter.hpp>
+
+namespace mbgl {
+
+/**
+ * Options for Map queries.
+ */
+class QueryOptions {
+public:
+ /** layerIDs to include in the query */
+ optional<std::vector<std::string>> layerIDs;
+
+ optional<style::Filter> filter;
+};
+
+}