1 | #pragma once |
---|---|
2 | |
3 | #include <mbgl/util/optional.hpp> |
4 | #include <mbgl/style/filter.hpp> |
5 | |
6 | #include <string> |
7 | #include <vector> |
8 | |
9 | namespace mbgl { |
10 | |
11 | /** |
12 | * Options for query rendered features. |
13 | */ |
14 | class RenderedQueryOptions { |
15 | public: |
16 | RenderedQueryOptions(optional<std::vector<std::string>> layerIDs_ = {}, |
17 | optional<style::Filter> filter_ = {}) |
18 | : layerIDs(std::move(layerIDs_)), |
19 | filter(std::move(filter_)) {} |
20 | |
21 | /** layerIDs to include in the query */ |
22 | optional<std::vector<std::string>> layerIDs; |
23 | |
24 | optional<style::Filter> filter; |
25 | }; |
26 | |
27 | /** |
28 | * Options for query source features |
29 | */ |
30 | class SourceQueryOptions { |
31 | public: |
32 | SourceQueryOptions(optional<std::vector<std::string>> sourceLayers_ = {}, |
33 | optional<style::Filter> filter_ = {}) |
34 | : sourceLayers(std::move(sourceLayers_)), |
35 | filter(std::move(filter_)) {} |
36 | |
37 | // Required for VectorSource, ignored for GeoJSONSource |
38 | optional<std::vector<std::string>> sourceLayers; |
39 | |
40 | optional<style::Filter> filter; |
41 | }; |
42 | |
43 | } // namespace mbgl |
44 |