summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-14 20:59:19 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-14 21:02:48 +0200
commite25b1830eee286dc43c9aca6dc0bba6ea436917b (patch)
treebdac265d1e8670679c6bab1637f149c939b316f8
parent57334407473a31ff43baa645dafd2f5e1bd910fb (diff)
downloadqtlocation-mapboxgl-upstream/alexshalamov_forward_eval_context.tar.gz
[core] Forward evaluation context directly to evaluated propertyupstream/alexshalamov_forward_eval_context
So that default value owned by the FormatSectionOverride, can be evaluated based on required context parameters.
-rw-r--r--include/mbgl/style/expression/format_section_override.hpp6
1 files changed, 5 insertions, 1 deletions
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<T>& e) { return e.getExpression().evaluate(context); },
+ [] (const T& t) -> EvaluationResult { return t; }
+ );
}
void eachChild(const std::function<void(const Expression&)>& fn) const final {