diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-03-14 20:59:19 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-03-15 10:37:45 +0200 |
commit | 69e11155c839b1f2a8685331b4104f82f1aa9882 (patch) | |
tree | bdac265d1e8670679c6bab1637f149c939b316f8 /include | |
parent | 57334407473a31ff43baa645dafd2f5e1bd910fb (diff) | |
download | qtlocation-mapboxgl-69e11155c839b1f2a8685331b4104f82f1aa9882.tar.gz |
[core] Forward evaluation context directly to evaluated property
So that default value owned by the FormatSectionOverride, can be
evaluated based on required context parameters.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/expression/format_section_override.hpp | 6 |
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 { |