summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/expression.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/expression/expression.hpp')
-rw-r--r--include/mbgl/style/expression/expression.hpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/mbgl/style/expression/expression.hpp b/include/mbgl/style/expression/expression.hpp
index 97b143b3d9..22ae57c2be 100644
--- a/include/mbgl/style/expression/expression.hpp
+++ b/include/mbgl/style/expression/expression.hpp
@@ -25,18 +25,26 @@ public:
class EvaluationContext {
public:
- EvaluationContext(float zoom_) : zoom(zoom_), feature(nullptr) {}
- EvaluationContext(GeometryTileFeature const * feature_) : zoom(optional<float>()), feature(feature_) {}
+ EvaluationContext() = default;
+ explicit EvaluationContext(float zoom_) : zoom(zoom_) {}
+ explicit EvaluationContext(GeometryTileFeature const * feature_) : feature(feature_) {}
EvaluationContext(float zoom_, GeometryTileFeature const * feature_) :
zoom(zoom_), feature(feature_)
{}
EvaluationContext(optional<float> zoom_, GeometryTileFeature const * feature_, optional<double> colorRampParameter_) :
zoom(std::move(zoom_)), feature(feature_), colorRampParameter(std::move(colorRampParameter_))
{}
-
+
+ EvaluationContext& withFormattedSection(const Value* formattedSection_) noexcept {
+ formattedSection = formattedSection_;
+ return *this;
+ };
+
optional<float> zoom;
- GeometryTileFeature const * feature;
+ GeometryTileFeature const * feature = nullptr;
optional<double> colorRampParameter;
+ // Contains formatted section object, std::unordered_map<std::string, Value>.
+ const Value* formattedSection = nullptr;
};
template <typename T>
@@ -134,6 +142,7 @@ enum class Kind : int32_t {
All,
Comparison,
FormatExpression,
+ FormatSectionOverride
};
class Expression {