From e25b1830eee286dc43c9aca6dc0bba6ea436917b Mon Sep 17 00:00:00 2001 From: Alexander Shalamov Date: Thu, 14 Mar 2019 20:59:19 +0200 Subject: [core] Forward evaluation context directly to evaluated property So that default value owned by the FormatSectionOverride, can be evaluated based on required context parameters. --- include/mbgl/style/expression/format_section_override.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/mbgl/style/expression/format_section_override.hpp b/include/mbgl/style/expression/format_section_override.hpp index 7dc3a8dbb4..63382fda51 100644 --- a/include/mbgl/style/expression/format_section_override.hpp +++ b/include/mbgl/style/expression/format_section_override.hpp @@ -27,7 +27,11 @@ public: return section.at(propertyName); } } - return defaultValue.evaluate(*context.feature, *context.zoom, T()); + + return defaultValue.match( + [&context] (const style::PropertyExpression& e) { return e.getExpression().evaluate(context); }, + [] (const T& t) -> EvaluationResult { return t; } + ); } void eachChild(const std::function& fn) const final { -- cgit v1.2.1