From 1adc585c61e1e42f28c7944816010446091fa161 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 10 Nov 2017 19:18:39 -0200 Subject: Bump Mapbox GL Native mapbox-gl-native @ 92608f58858d77c17a65ae9b29758e74bb2da7d2 --- .../conversion/data_driven_property_value.hpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/mbgl/style/conversion/data_driven_property_value.hpp') diff --git a/include/mbgl/style/conversion/data_driven_property_value.hpp b/include/mbgl/style/conversion/data_driven_property_value.hpp index 1e54c15a49..8880d28fb1 100644 --- a/include/mbgl/style/conversion/data_driven_property_value.hpp +++ b/include/mbgl/style/conversion/data_driven_property_value.hpp @@ -4,6 +4,13 @@ #include #include #include +#include +#include +#include +#include + +#include + namespace mbgl { namespace style { @@ -11,9 +18,27 @@ namespace conversion { template struct Converter> { + optional> operator()(const Convertible& value, Error& error) const { if (isUndefined(value)) { return DataDrivenPropertyValue(); + } else if (expression::isExpression(value)) { + optional> expression = convert>( + value, + error, + valueTypeToExpressionType()); + + if (!expression) { + return {}; + } + + if (isFeatureConstant(**expression)) { + return DataDrivenPropertyValue(CameraFunction(std::move(*expression))); + } else if (isZoomConstant(**expression)) { + return DataDrivenPropertyValue(SourceFunction(std::move(*expression))); + } else { + return DataDrivenPropertyValue(CompositeFunction(std::move(*expression))); + } } else if (!isObject(value)) { optional constant = convert(value, error); if (!constant) { -- cgit v1.2.1