summaryrefslogtreecommitdiff
path: root/src/mbgl/style/properties.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/properties.hpp')
-rw-r--r--src/mbgl/style/properties.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp
index 9d66f850de..b07456a96d 100644
--- a/src/mbgl/style/properties.hpp
+++ b/src/mbgl/style/properties.hpp
@@ -180,11 +180,28 @@ public:
});
}
+ template <class T>
+ static T evaluate(float z, const GeometryTileFeature& feature, const FeatureState& state,
+ const PossiblyEvaluatedPropertyValue<T>& v, const T& defaultValue) {
+ return v.match(
+ [&] (const T& t) {
+ return t;
+ },
+ [&] (const PropertyExpression<T>& t) {
+ return t.evaluate(z, feature, state, defaultValue);
+ });
+ }
+
template <class P>
auto evaluate(float z, const GeometryTileFeature& feature) const {
return evaluate(z, feature, this->template get<P>(), P::defaultValue());
}
+ template <class P>
+ auto evaluate(float z, const GeometryTileFeature& feature, const FeatureState& state) const {
+ return evaluate(z, feature, state, this->template get<P>(), P::defaultValue());
+ }
+
Evaluated evaluate(float z, const GeometryTileFeature& feature) const {
return Evaluated {
evaluate<Ps>(z, feature)...