summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/rotation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/conversion/rotation.cpp')
-rw-r--r--src/mbgl/style/conversion/rotation.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mbgl/style/conversion/rotation.cpp b/src/mbgl/style/conversion/rotation.cpp
new file mode 100644
index 0000000000..9b382b7400
--- /dev/null
+++ b/src/mbgl/style/conversion/rotation.cpp
@@ -0,0 +1,20 @@
+#include <mbgl/style/conversion/rotation.hpp>
+#include <mbgl/style/conversion/constant.hpp>
+#include <mbgl/style/conversion_impl.hpp>
+
+namespace mbgl {
+namespace style {
+namespace conversion {
+
+optional<style::Rotation> Converter<style::Rotation>::operator()(const Convertible& value, Error& error) const {
+ optional<double> converted = toDouble(value);
+ if (!converted) {
+ error.message = "value must be a number";
+ return nullopt;
+ }
+ return {*converted};
+}
+
+} // namespace conversion
+} // namespace style
+} // namespace mbgl