summaryrefslogtreecommitdiff
path: root/include/mbgl/style/data_driven_property_value.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-03-22 16:44:12 -0700
committerGitHub <noreply@github.com>2018-03-22 16:44:12 -0700
commit9499a2bda7eed68f8a11cdecce0130b1be2054a4 (patch)
treebf26cc0af726388039a1d6de12cc3a091a2ec175 /include/mbgl/style/data_driven_property_value.hpp
parent1d29f82c1b636166053874323ee04ade5b243275 (diff)
downloadqtlocation-mapboxgl-9499a2bda7eed68f8a11cdecce0130b1be2054a4.tar.gz
[core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509)
Diffstat (limited to 'include/mbgl/style/data_driven_property_value.hpp')
-rw-r--r--include/mbgl/style/data_driven_property_value.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mbgl/style/data_driven_property_value.hpp b/include/mbgl/style/data_driven_property_value.hpp
index 5d7c596363..0a1fce29c7 100644
--- a/include/mbgl/style/data_driven_property_value.hpp
+++ b/include/mbgl/style/data_driven_property_value.hpp
@@ -50,6 +50,15 @@ public:
return !value.template is<CameraFunction<T>>() && !value.template is<CompositeFunction<T>>();
}
+ bool isExpression() const {
+ return value.match(
+ [] (const Undefined&) { return false; },
+ [] (const T&) { return false; },
+ [] (const CameraFunction<T>& fn) { return fn.isExpression; },
+ [] (const SourceFunction<T>& fn) { return fn.isExpression; },
+ [] (const CompositeFunction<T>& fn) { return fn.isExpression; });
+ }
+
template <class... Ts>
auto match(Ts&&... ts) const {
return value.match(std::forward<Ts>(ts)...);