diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-28 16:39:50 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-02 09:44:42 -0800 |
commit | 141e995806576364d185626176c1b993fc519291 (patch) | |
tree | ecdc41fc7699f2a1a9e9456157348451ebe99597 /include/mbgl/style/conversion/property_setter.hpp | |
parent | 6a6bddb4537004cc1bfc506e76772de74d33f3f7 (diff) | |
download | qtlocation-mapboxgl-141e995806576364d185626176c1b993fc519291.tar.gz |
[core] Add support for data-driven styling
Diffstat (limited to 'include/mbgl/style/conversion/property_setter.hpp')
-rw-r--r-- | include/mbgl/style/conversion/property_setter.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/mbgl/style/conversion/property_setter.hpp b/include/mbgl/style/conversion/property_setter.hpp index 1a601c7c1b..52fb160fde 100644 --- a/include/mbgl/style/conversion/property_setter.hpp +++ b/include/mbgl/style/conversion/property_setter.hpp @@ -4,6 +4,7 @@ #include <mbgl/style/conversion.hpp> #include <mbgl/style/conversion/constant.hpp> #include <mbgl/style/conversion/property_value.hpp> +#include <mbgl/style/conversion/data_driven_property_value.hpp> #include <functional> #include <string> @@ -18,15 +19,15 @@ using LayoutPropertySetter = std::function<optional<Error> (Layer&, const V&)>; template <class V> using PaintPropertySetter = std::function<optional<Error> (Layer&, const V&, const optional<std::string>&)>; -template <class V, class L, class T, class...Args> -auto makePropertySetter(void (L::*setter)(PropertyValue<T>, const Args&...args)) { +template <class V, class L, class PropertyValue, class...Args> +auto makePropertySetter(void (L::*setter)(PropertyValue, const Args&...args)) { return [setter] (Layer& layer, const V& value, const Args&...args) -> optional<Error> { L* typedLayer = layer.as<L>(); if (!typedLayer) { return Error { "layer doesn't support this property" }; } - Result<PropertyValue<T>> typedValue = convert<PropertyValue<T>>(value); + Result<PropertyValue> typedValue = convert<PropertyValue>(value); if (!typedValue) { return typedValue.error(); } |