summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-06 10:12:56 +0300
committergalinelle <paolo.angelelli@mapbox.com>2020-04-08 14:00:26 +0300
commit8e581c88ea855998a2746e57f1a5fc46ee62faee (patch)
tree9a158b1a4281a6c894025cc6758a0c9c59dfd5b0 /include/mbgl/style/expression
parent9a55c282fecfdd76b1acdf64cef0ce2ed99472ef (diff)
downloadqtlocation-mapboxgl-8e581c88ea855998a2746e57f1a5fc46ee62faee.tar.gz
Make location indicator bearing a paint property
This change introduces a new property type, Rotation, that uses a custom interpolator, and that is currently applied to all style properties named "bearing", with a period attribute.
Diffstat (limited to 'include/mbgl/style/expression')
-rw-r--r--include/mbgl/style/expression/value.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/style/expression/value.hpp b/include/mbgl/style/expression/value.hpp
index 902f5ae209..6f12bb9336 100644
--- a/include/mbgl/style/expression/value.hpp
+++ b/include/mbgl/style/expression/value.hpp
@@ -5,6 +5,7 @@
#include <mbgl/style/expression/image.hpp>
#include <mbgl/style/expression/type.hpp>
#include <mbgl/style/position.hpp>
+#include <mbgl/style/rotation.hpp>
#include <mbgl/style/types.hpp>
#include <mbgl/util/color.hpp>
#include <mbgl/util/enum.hpp>
@@ -147,6 +148,13 @@ std::vector<optional<T>> fromExpressionValues(const std::vector<optional<Value>>
return result;
}
+template <>
+struct ValueConverter<Rotation> {
+ static type::Type expressionType() { return type::Number; }
+ static Value toExpressionValue(const mbgl::style::Rotation& value);
+ static optional<Rotation> fromExpressionValue(const Value& v);
+};
+
} // namespace expression
} // namespace style
} // namespace mbgl