diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-26 18:26:11 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-27 13:08:53 +0300 |
commit | d90b2bb6dc2a19961e029963e591d702f70dd721 (patch) | |
tree | 489d68b1186a3fe7da0b77c77e5e5f79fc1c6d31 /include | |
parent | 5304bbc438afd60853c97d74cd38f04a50effa06 (diff) | |
download | qtlocation-mapboxgl-d90b2bb6dc2a19961e029963e591d702f70dd721.tar.gz |
[core] Introduce Light::getProperty()
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/conversion_impl.hpp | 7 | ||||
-rw-r--r-- | include/mbgl/style/light.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/style/light.hpp.ejs | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/style/conversion_impl.hpp b/include/mbgl/style/conversion_impl.hpp index 7abe7bf923..3e4236949e 100644 --- a/include/mbgl/style/conversion_impl.hpp +++ b/include/mbgl/style/conversion_impl.hpp @@ -342,6 +342,13 @@ struct ValueFactory<T, typename std::enable_if<is_linear_container<T>::value>::t } }; +template <> +struct ValueFactory<Position> { + static Value make(const Position& position) { + return ValueFactory<std::array<float, 3>>::make(position.getSpherical()); + } +}; + template <typename T> Value makeValue(T&& arg) { return ValueFactory<std::decay_t<T>>::make(std::forward<T>(arg)); diff --git a/include/mbgl/style/light.hpp b/include/mbgl/style/light.hpp index 9a82eb14b5..7434fb2882 100644 --- a/include/mbgl/style/light.hpp +++ b/include/mbgl/style/light.hpp @@ -6,6 +6,7 @@ #include <mbgl/style/conversion.hpp> #include <mbgl/style/property_value.hpp> +#include <mbgl/style/style_property.hpp> #include <mbgl/style/transition_options.hpp> #include <mbgl/style/types.hpp> #include <mbgl/util/immutable.hpp> @@ -22,6 +23,7 @@ public: // Dynamic properties optional<conversion::Error> setProperty(const std::string& name, const conversion::Convertible& value); + StyleProperty getProperty(const std::string&) const; static LightAnchorType getDefaultAnchor(); PropertyValue<LightAnchorType> getAnchor() const; diff --git a/include/mbgl/style/light.hpp.ejs b/include/mbgl/style/light.hpp.ejs index a5b907b4dc..e4661dc59b 100644 --- a/include/mbgl/style/light.hpp.ejs +++ b/include/mbgl/style/light.hpp.ejs @@ -9,6 +9,7 @@ #include <mbgl/style/conversion.hpp> #include <mbgl/style/property_value.hpp> +#include <mbgl/style/style_property.hpp> #include <mbgl/style/transition_options.hpp> #include <mbgl/style/types.hpp> #include <mbgl/util/immutable.hpp> @@ -25,6 +26,7 @@ public: // Dynamic properties optional<conversion::Error> setProperty(const std::string& name, const conversion::Convertible& value); + StyleProperty getProperty(const std::string&) const; <% for (const property of properties) { -%> static <%- evaluatedType(property) %> getDefault<%- camelize(property.name) %>(); |