summaryrefslogtreecommitdiff
path: root/include
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-15 10:37:45 +0200
commit69e11155c839b1f2a8685331b4104f82f1aa9882 (patch)
treebdac265d1e8670679c6bab1637f149c939b316f8 /include
parent57334407473a31ff43baa645dafd2f5e1bd910fb (diff)
downloadqtlocation-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.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 {