From 6fdf07e3a7df8b94fbb78bd534b032006b70b470 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 11 Sep 2019 13:47:22 +0300 Subject: [core] Use mbgl::underlying_type in style properties --- src/mbgl/style/layers/hillshade_layer.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/mbgl/style/layers/hillshade_layer.cpp') diff --git a/src/mbgl/style/layers/hillshade_layer.cpp b/src/mbgl/style/layers/hillshade_layer.cpp index ba22ab25ab..95a395ef25 100644 --- a/src/mbgl/style/layers/hillshade_layer.cpp +++ b/src/mbgl/style/layers/hillshade_layer.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -228,7 +229,7 @@ TransitionOptions HillshadeLayer::getHillshadeShadowColorTransition() const { using namespace conversion; optional HillshadeLayer::setPaintProperty(const std::string& name, const Convertible& value) { - enum class Property : uint8_t { + enum class Property { HillshadeAccentColor, HillshadeExaggeration, HillshadeHighlightColor, @@ -244,18 +245,18 @@ optional HillshadeLayer::setPaintProperty(const std::string& name, const }; MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map({ - { "hillshade-accent-color", static_cast(Property::HillshadeAccentColor) }, - { "hillshade-exaggeration", static_cast(Property::HillshadeExaggeration) }, - { "hillshade-highlight-color", static_cast(Property::HillshadeHighlightColor) }, - { "hillshade-illumination-anchor", static_cast(Property::HillshadeIlluminationAnchor) }, - { "hillshade-illumination-direction", static_cast(Property::HillshadeIlluminationDirection) }, - { "hillshade-shadow-color", static_cast(Property::HillshadeShadowColor) }, - { "hillshade-accent-color-transition", static_cast(Property::HillshadeAccentColorTransition) }, - { "hillshade-exaggeration-transition", static_cast(Property::HillshadeExaggerationTransition) }, - { "hillshade-highlight-color-transition", static_cast(Property::HillshadeHighlightColorTransition) }, - { "hillshade-illumination-anchor-transition", static_cast(Property::HillshadeIlluminationAnchorTransition) }, - { "hillshade-illumination-direction-transition", static_cast(Property::HillshadeIlluminationDirectionTransition) }, - { "hillshade-shadow-color-transition", static_cast(Property::HillshadeShadowColorTransition) } + { "hillshade-accent-color", mbgl::underlying_type(Property::HillshadeAccentColor) }, + { "hillshade-exaggeration", mbgl::underlying_type(Property::HillshadeExaggeration) }, + { "hillshade-highlight-color", mbgl::underlying_type(Property::HillshadeHighlightColor) }, + { "hillshade-illumination-anchor", mbgl::underlying_type(Property::HillshadeIlluminationAnchor) }, + { "hillshade-illumination-direction", mbgl::underlying_type(Property::HillshadeIlluminationDirection) }, + { "hillshade-shadow-color", mbgl::underlying_type(Property::HillshadeShadowColor) }, + { "hillshade-accent-color-transition", mbgl::underlying_type(Property::HillshadeAccentColorTransition) }, + { "hillshade-exaggeration-transition", mbgl::underlying_type(Property::HillshadeExaggerationTransition) }, + { "hillshade-highlight-color-transition", mbgl::underlying_type(Property::HillshadeHighlightColorTransition) }, + { "hillshade-illumination-anchor-transition", mbgl::underlying_type(Property::HillshadeIlluminationAnchorTransition) }, + { "hillshade-illumination-direction-transition", mbgl::underlying_type(Property::HillshadeIlluminationDirectionTransition) }, + { "hillshade-shadow-color-transition", mbgl::underlying_type(Property::HillshadeShadowColorTransition) } }); const auto it = properties.find(name.c_str()); -- cgit v1.2.1