diff options
Diffstat (limited to 'include/mbgl/style')
-rw-r--r-- | include/mbgl/style/conversion/constant.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/style/expression/value.hpp | 7 | ||||
-rw-r--r-- | include/mbgl/style/layers/symbol_layer.hpp | 6 | ||||
-rw-r--r-- | include/mbgl/style/types.hpp | 7 |
4 files changed, 22 insertions, 3 deletions
diff --git a/include/mbgl/style/conversion/constant.hpp b/include/mbgl/style/conversion/constant.hpp index 3a5833be64..f82029c885 100644 --- a/include/mbgl/style/conversion/constant.hpp +++ b/include/mbgl/style/conversion/constant.hpp @@ -59,6 +59,11 @@ struct Converter<std::vector<std::string>> { optional<std::vector<std::string>> operator()(const Convertible& value, Error& error) const; }; +template <> +struct Converter<RadialOffsetType> { + optional<RadialOffsetType> operator()(const Convertible& value, Error& error) const; +}; + } // namespace conversion } // namespace style } // namespace mbgl diff --git a/include/mbgl/style/expression/value.hpp b/include/mbgl/style/expression/value.hpp index 91239d083f..5cb0535184 100644 --- a/include/mbgl/style/expression/value.hpp +++ b/include/mbgl/style/expression/value.hpp @@ -114,6 +114,13 @@ struct ValueConverter<std::vector<T>> { }; template <> +struct ValueConverter<RadialOffsetType> { + static type::Type expressionType() { return type::Array(type::Number); } + static Value toExpressionValue(const mbgl::style::RadialOffsetType& value); + static optional<RadialOffsetType> fromExpressionValue(const Value& v); +}; + +template <> struct ValueConverter<Position> { static type::Type expressionType() { return type::Array(type::Number, 3); } static Value toExpressionValue(const mbgl::style::Position& value); diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 2493df6046..ee0c91fd14 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -162,9 +162,9 @@ public: const PropertyValue<AlignmentType>& getTextPitchAlignment() const; void setTextPitchAlignment(const PropertyValue<AlignmentType>&); - static PropertyValue<float> getDefaultTextRadialOffset(); - const PropertyValue<float>& getTextRadialOffset() const; - void setTextRadialOffset(const PropertyValue<float>&); + static PropertyValue<RadialOffsetType> getDefaultTextRadialOffset(); + const PropertyValue<RadialOffsetType>& getTextRadialOffset() const; + void setTextRadialOffset(const PropertyValue<RadialOffsetType>&); static PropertyValue<float> getDefaultTextRotate(); const PropertyValue<float>& getTextRotate() const; diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp index 13a2e50f01..06e549e37d 100644 --- a/include/mbgl/style/types.hpp +++ b/include/mbgl/style/types.hpp @@ -1,6 +1,7 @@ #pragma once #include <cstdint> +#include <vector> namespace mbgl { @@ -120,5 +121,11 @@ enum class LightAnchorType: bool { Viewport }; +class RadialOffsetType: public std::vector<float> { +public: + template <typename... Args> + RadialOffsetType(Args&&... args) : std::vector<float>(std::forward<Args>(args)...) {} +}; + } // namespace style } // namespace mbgl |