diff options
author | Lucas Wojciechowski <lucas@mapbox.com> | 2018-02-19 14:16:05 -0800 |
---|---|---|
committer | Lucas Wojciechowski <lucas@mapbox.com> | 2018-03-07 11:46:17 -0800 |
commit | 392fe113b529f705cee4a1757eedc6ef48023574 (patch) | |
tree | 4f0c13eb1e8b2b1aec6e41e7021ae1c353adcb2f | |
parent | d4aac8e8830c401ab8fa8ee6700cc5f60bf56e9a (diff) | |
download | qtlocation-mapboxgl-392fe113b529f705cee4a1757eedc6ef48023574.tar.gz |
Hook up expression filter evaluator
-rw-r--r-- | src/mbgl/style/filter_evaluator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/style/filter_evaluator.cpp b/src/mbgl/style/filter_evaluator.cpp index 3645a01728..72022172f4 100644 --- a/src/mbgl/style/filter_evaluator.cpp +++ b/src/mbgl/style/filter_evaluator.cpp @@ -212,7 +212,12 @@ bool FilterEvaluator::operator()(const NotHasIdentifierFilter&) const { return !context.feature->getID(); } -bool FilterEvaluator::operator()(const ExpressionFilter&) const { +bool FilterEvaluator::operator()(const ExpressionFilter& filter) const { + const expression::EvaluationResult result = filter.expression->evaluate(context); + if (result) { + const optional<bool> typed = expression::fromExpressionValue<bool>(*result); + return typed ? *typed : false; + } return false; } |