diff options
author | Asheem Mamoowala <asheemm@gmail.com> | 2017-02-21 18:34:45 -0800 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-03-04 15:42:07 -0800 |
commit | 60d10dd27df38ac4e97214d1cd514198c381695c (patch) | |
tree | f4ce0ecbf3a7eeb5c19f994d02152fc624b458d9 /include/mbgl/style | |
parent | ac4e13416a36905b35401fc1a982c680ca37a3d0 (diff) | |
download | qtlocation-mapboxgl-60d10dd27df38ac4e97214d1cd514198c381695c.tar.gz |
[core] Add support for queryRenderedFeatures filter
Diffstat (limited to 'include/mbgl/style')
-rw-r--r-- | include/mbgl/style/filter.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/style/filter_evaluator.hpp | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/style/filter.hpp b/include/mbgl/style/filter.hpp index 5e61adf064..a204a2b17a 100644 --- a/include/mbgl/style/filter.hpp +++ b/include/mbgl/style/filter.hpp @@ -266,6 +266,9 @@ public: bool operator()(const Feature&) const; + template <class GeometryTileFeature> + bool operator()(const GeometryTileFeature&) const; + template <class PropertyAccessor> bool operator()(FeatureType type, optional<FeatureIdentifier> id, PropertyAccessor accessor) const; }; diff --git a/include/mbgl/style/filter_evaluator.hpp b/include/mbgl/style/filter_evaluator.hpp index 370064445a..66223d7282 100644 --- a/include/mbgl/style/filter_evaluator.hpp +++ b/include/mbgl/style/filter_evaluator.hpp @@ -246,6 +246,11 @@ inline bool Filter::operator()(const Feature& feature) const { }); } +template <class GeometryTileFeature> +bool Filter::operator()(const GeometryTileFeature& feature) const { + return operator()(feature.getType(), feature.getID(), [&] (const auto& key) { return feature.getValue(key); }); +} + template <class PropertyAccessor> bool Filter::operator()(FeatureType type, optional<FeatureIdentifier> id, PropertyAccessor accessor) const { return FilterBase::visit(*this, FilterEvaluator<PropertyAccessor> { type, id, accessor }); |