diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-10 12:37:46 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-15 09:45:55 -0700 |
commit | 9eba2a66d107f30aa9216fb34ed62df60797986a (patch) | |
tree | d334e6f3b5154b3dc5a49d87e8be9b42df2b212a /include/mbgl/style/conversion/property_setter.hpp | |
parent | e473f2dcceb31eda816ac9e6c972d7e0a8f1dceb (diff) | |
download | qtlocation-mapboxgl-9eba2a66d107f30aa9216fb34ed62df60797986a.tar.gz |
[core, node, darwin, qt] Remove support for paint classes
Diffstat (limited to 'include/mbgl/style/conversion/property_setter.hpp')
-rw-r--r-- | include/mbgl/style/conversion/property_setter.hpp | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/include/mbgl/style/conversion/property_setter.hpp b/include/mbgl/style/conversion/property_setter.hpp index 8658fd60b0..759c4512cc 100644 --- a/include/mbgl/style/conversion/property_setter.hpp +++ b/include/mbgl/style/conversion/property_setter.hpp @@ -14,13 +14,10 @@ namespace style { namespace conversion { template <class V> -using LayoutPropertySetter = optional<Error> (*) (Layer&, const V&); - -template <class V> -using PaintPropertySetter = optional<Error> (*) (Layer&, const V&, const optional<std::string>&); +using PropertySetter = optional<Error> (*) (Layer&, const V&); template <class V, class L, class PropertyValue, void (L::*setter)(PropertyValue)> -optional<Error> setLayoutProperty(Layer& layer, const V& value) { +optional<Error> setProperty(Layer& layer, const V& value) { auto* typedLayer = layer.as<L>(); if (!typedLayer) { return Error { "layer doesn't support this property" }; @@ -36,25 +33,8 @@ optional<Error> setLayoutProperty(Layer& layer, const V& value) { return {}; } -template <class V, class L, class PropertyValue, void (L::*setter)(PropertyValue, const optional<std::string>&)> -optional<Error> setPaintProperty(Layer& layer, const V& value, const optional<std::string>& klass) { - auto* typedLayer = layer.as<L>(); - if (!typedLayer) { - return Error { "layer doesn't support this property" }; - } - - Error error; - optional<PropertyValue> typedValue = convert<PropertyValue>(value, error); - if (!typedValue) { - return error; - } - - (typedLayer->*setter)(*typedValue, klass); - return {}; -} - -template <class V, class L, void (L::*setter)(const TransitionOptions&, const optional<std::string>&)> -optional<Error> setTransition(Layer& layer, const V& value, const optional<std::string>& klass) { +template <class V, class L, void (L::*setter)(const TransitionOptions&)> +optional<Error> setTransition(Layer& layer, const V& value) { auto* typedLayer = layer.as<L>(); if (!typedLayer) { return Error { "layer doesn't support this property" }; @@ -66,7 +46,7 @@ optional<Error> setTransition(Layer& layer, const V& value, const optional<std:: return error; } - (typedLayer->*setter)(*transition, klass); + (typedLayer->*setter)(*transition); return {}; } |