blob: 18b8b0a7f4fdaf8695a8ac7b2b45663d501e1fa5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <mbgl/style/filter.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
namespace mbgl {
namespace style {
bool Filter::operator()(const expression::EvaluationContext &context) const {
if (!this->expression) return true;
const expression::EvaluationResult result = (*this->expression)->evaluate(context);
if (result) {
const optional<bool> typed = expression::fromExpressionValue<bool>(*result);
return typed ? *typed : false;
} else {
return false;
}
}
} // namespace style
} // namespace mbgl
|