summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/conversion/property_value.hpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/mbgl/style/conversion/property_value.hpp b/include/mbgl/style/conversion/property_value.hpp
index 3130661f61..dc1c32830f 100644
--- a/include/mbgl/style/conversion/property_value.hpp
+++ b/include/mbgl/style/conversion/property_value.hpp
@@ -29,11 +29,19 @@ struct Converter<PropertyValue<T>> {
return {};
}
- if (isFeatureConstant(**expression)) {
- return { CameraFunction<T>(std::move(*expression)) };
- } else {
+ if (!isFeatureConstant(**expression)) {
error = { "property expressions not supported" };
return {};
+ } else if (!isZoomConstant(**expression)) {
+ return { CameraFunction<T>(std::move(*expression)) };
+ } else {
+ auto literal = dynamic_cast<Literal*>(expression->get());
+ assert(literal);
+ optional<T> constant = fromExpressionValue<T>(literal->getValue());
+ if (!constant) {
+ return {};
+ }
+ return PropertyValue<T>(*constant);
}
} else if (isObject(value)) {
optional<CameraFunction<T>> function = convert<CameraFunction<T>>(value, error);