diff options
author | Lucas Wojciechowski <lucas@lucaswoj.com> | 2018-03-08 15:48:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 15:48:08 -0800 |
commit | 5b3ebc4a2429c202f08c7468c300950de4844615 (patch) | |
tree | 177fd5ebc840f48d537df17c3a47fe266421109f /src/mbgl/style/filter.cpp | |
parent | 268a4d7404d30dc4f866711e3fd1e778892bbe35 (diff) | |
download | qtlocation-mapboxgl-5b3ebc4a2429c202f08c7468c300950de4844615.tar.gz |
[core] Add expression filter support (#11251)
* WIP
* WIP
* WIP
* Remove Filter::operator()(const Feature&)
* WIP
* WIP
* WIP
* WIP
* Hook up expression filter evaluator
* Replace `shared_ptr` with &reference
* Fill in implementation of `void operator()(const ExpressionFilter&)`
* Fix failing tests
* Switch back to a shared_ptr per chat with @anandthakker
* Fix benchmark compilation
* Shot in the dark to fix CI
* Shot in the dark to fix CI (part 2)
* Shot in the dark to fix CI (part 3)
* In src/mbgl/style/conversion/filter.cpp, add a port of isExpressionFilter and use it to decide in Converter<Filter>::operator() whether to parse the incoming JSON as an ExpressionFilter or one of the legacy filter types
* Remove bool Filter::operator()(const GeometryTileFeature&) const
* Ensure the map zoom is passed into filtering operations wherever applicable
* Add expression filter tests
* Addressed PR feedback
* Implement `NSPredicate *operator()(mbgl::style::ExpressionFilter filter)`
* Fix formatting& nit
Diffstat (limited to 'src/mbgl/style/filter.cpp')
-rw-r--r-- | src/mbgl/style/filter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mbgl/style/filter.cpp b/src/mbgl/style/filter.cpp new file mode 100644 index 0000000000..51aa6bcf82 --- /dev/null +++ b/src/mbgl/style/filter.cpp @@ -0,0 +1,13 @@ +#include <mbgl/style/filter.hpp> +#include <mbgl/style/filter_evaluator.hpp> +#include <mbgl/tile/geometry_tile_data.hpp> + +namespace mbgl { +namespace style { + +bool Filter::operator()(const expression::EvaluationContext &context) const { + return FilterBase::visit(*this, FilterEvaluator { context }); +} + +} // namespace style +} // namespace mbgl |