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.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp
index 2fab53ad12..39b6672734 100644
--- a/src/mbgl/style/properties.hpp
+++ b/src/mbgl/style/properties.hpp
@@ -169,6 +169,11 @@ public:
}
template <class T>
+ static T evaluate(float, const GeometryTileFeature&, const CanonicalTileID&, const T& t, const T&) {
+ return t;
+ }
+
+ template <class T>
static T evaluate(float z,
const GeometryTileFeature& feature,
const PossiblyEvaluatedPropertyValue<T>& v,
@@ -194,6 +199,30 @@ 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,
+ const CanonicalTileID& canonical) {
+ return v.match([&](const T& t) { return t; },
+ [&](const PropertyExpression<T>& t) {
+ return t.evaluate(z, feature, availableImages, canonical, defaultValue);
+ });
+ }
+
+ template <class T>
+ static T evaluate(float z,
+ const GeometryTileFeature& feature,
+ const CanonicalTileID& canonical,
+ const PossiblyEvaluatedPropertyValue<T>& v,
+ const T& defaultValue) {
+ return v.match(
+ [&](const T& t) { return t; },
+ [&](const PropertyExpression<T>& t) { return t.evaluate(z, feature, canonical, 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; },
@@ -220,6 +249,14 @@ public:
return evaluate(z, feature, this->template get<P>(), P::defaultValue(), availableImages);
}
+ template <class P>
+ auto evaluate(float z,
+ const GeometryTileFeature& feature,
+ const std::set<std::string>& availableImages,
+ const CanonicalTileID& canonical) const {
+ return evaluate(z, feature, this->template get<P>(), P::defaultValue(), availableImages, canonical);
+ }
+
Evaluated evaluate(float z, const GeometryTileFeature& feature) const {
return Evaluated {
evaluate<Ps>(z, feature)...