diff options
Diffstat (limited to 'src/mbgl/style/properties.hpp')
-rw-r--r-- | src/mbgl/style/properties.hpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp index db0e54330c..9c8996fcbe 100644 --- a/src/mbgl/style/properties.hpp +++ b/src/mbgl/style/properties.hpp @@ -169,8 +169,10 @@ public: } template <class T> - static T evaluate(float z, const GeometryTileFeature& feature, - const PossiblyEvaluatedPropertyValue<T>& v, const T& defaultValue) { + static T evaluate(float z, + const GeometryTileFeature& feature, + const PossiblyEvaluatedPropertyValue<T>& v, + const T& defaultValue) { return v.match( [&] (const T& t) { return t; @@ -181,6 +183,17 @@ public: } template <class T> + static T evaluate(float z, + const GeometryTileFeature& feature, + const PossiblyEvaluatedPropertyValue<T>& v, + const T& defaultValue, + const std::set<std::string>& availableImages) { + return v.match( + [&](const T& t) { return t; }, + [&](const PropertyExpression<T>& t) { return t.evaluate(z, feature, availableImages, defaultValue); }); + } + + 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; }, @@ -197,6 +210,11 @@ public: return evaluate(z, feature, state, this->template get<P>(), P::defaultValue()); } + template <class P> + auto evaluate(float z, const GeometryTileFeature& feature, const std::set<std::string>& availableImages) const { + return evaluate(z, feature, this->template get<P>(), P::defaultValue(), availableImages); + } + Evaluated evaluate(float z, const GeometryTileFeature& feature) const { return Evaluated { evaluate<Ps>(z, feature)... |