diff options
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer.cpp')
-rw-r--r-- | src/mbgl/style/layers/symbol_layer.cpp | 76 |
1 files changed, 45 insertions, 31 deletions
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index b3ee0f698c..1383293d6d 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -109,15 +109,15 @@ void SymbolLayer::setIconIgnorePlacement(const PropertyValue<bool>& value) { baseImpl = std::move(impl_); observer->onLayerChanged(*this); } -PropertyValue<std::string> SymbolLayer::getDefaultIconImage() { +PropertyValue<expression::Image> SymbolLayer::getDefaultIconImage() { return IconImage::defaultValue(); } -const PropertyValue<std::string>& SymbolLayer::getIconImage() const { +const PropertyValue<expression::Image>& SymbolLayer::getIconImage() const { return impl().layout.get<IconImage>(); } -void SymbolLayer::setIconImage(const PropertyValue<std::string>& value) { +void SymbolLayer::setIconImage(const PropertyValue<expression::Image>& value) { if (value == getIconImage()) return; auto impl_ = mutableImpl(); @@ -721,7 +721,7 @@ void SymbolLayer::setTextWritingMode(const PropertyValue<std::vector<TextWriting // Paint properties PropertyValue<Color> SymbolLayer::getDefaultIconColor() { - return { Color::black() }; + return {Color::black()}; } const PropertyValue<Color>& SymbolLayer::getIconColor() const { @@ -748,7 +748,7 @@ TransitionOptions SymbolLayer::getIconColorTransition() const { } PropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() { - return { 0 }; + return {0}; } const PropertyValue<float>& SymbolLayer::getIconHaloBlur() const { @@ -775,7 +775,7 @@ TransitionOptions SymbolLayer::getIconHaloBlurTransition() const { } PropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() { - return { {} }; + return {{}}; } const PropertyValue<Color>& SymbolLayer::getIconHaloColor() const { @@ -802,7 +802,7 @@ TransitionOptions SymbolLayer::getIconHaloColorTransition() const { } PropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() { - return { 0 }; + return {0}; } const PropertyValue<float>& SymbolLayer::getIconHaloWidth() const { @@ -829,7 +829,7 @@ TransitionOptions SymbolLayer::getIconHaloWidthTransition() const { } PropertyValue<float> SymbolLayer::getDefaultIconOpacity() { - return { 1 }; + return {1}; } const PropertyValue<float>& SymbolLayer::getIconOpacity() const { @@ -856,7 +856,7 @@ TransitionOptions SymbolLayer::getIconOpacityTransition() const { } PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() { - return { {{ 0, 0 }} }; + return {{{0, 0}}}; } const PropertyValue<std::array<float, 2>>& SymbolLayer::getIconTranslate() const { @@ -883,7 +883,7 @@ TransitionOptions SymbolLayer::getIconTranslateTransition() const { } PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() { - return { TranslateAnchorType::Map }; + return {TranslateAnchorType::Map}; } const PropertyValue<TranslateAnchorType>& SymbolLayer::getIconTranslateAnchor() const { @@ -910,7 +910,7 @@ TransitionOptions SymbolLayer::getIconTranslateAnchorTransition() const { } PropertyValue<Color> SymbolLayer::getDefaultTextColor() { - return { Color::black() }; + return {Color::black()}; } const PropertyValue<Color>& SymbolLayer::getTextColor() const { @@ -937,7 +937,7 @@ TransitionOptions SymbolLayer::getTextColorTransition() const { } PropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() { - return { 0 }; + return {0}; } const PropertyValue<float>& SymbolLayer::getTextHaloBlur() const { @@ -964,7 +964,7 @@ TransitionOptions SymbolLayer::getTextHaloBlurTransition() const { } PropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() { - return { {} }; + return {{}}; } const PropertyValue<Color>& SymbolLayer::getTextHaloColor() const { @@ -991,7 +991,7 @@ TransitionOptions SymbolLayer::getTextHaloColorTransition() const { } PropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() { - return { 0 }; + return {0}; } const PropertyValue<float>& SymbolLayer::getTextHaloWidth() const { @@ -1018,7 +1018,7 @@ TransitionOptions SymbolLayer::getTextHaloWidthTransition() const { } PropertyValue<float> SymbolLayer::getDefaultTextOpacity() { - return { 1 }; + return {1}; } const PropertyValue<float>& SymbolLayer::getTextOpacity() const { @@ -1045,7 +1045,7 @@ TransitionOptions SymbolLayer::getTextOpacityTransition() const { } PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() { - return { {{ 0, 0 }} }; + return {{{0, 0}}}; } const PropertyValue<std::array<float, 2>>& SymbolLayer::getTextTranslate() const { @@ -1072,7 +1072,7 @@ TransitionOptions SymbolLayer::getTextTranslateTransition() const { } PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() { - return { TranslateAnchorType::Map }; + return {TranslateAnchorType::Map}; } const PropertyValue<TranslateAnchorType>& SymbolLayer::getTextTranslateAnchor() const { @@ -1332,7 +1332,8 @@ optional<Error> SymbolLayer::setPaintProperty(const std::string& name, const Con if (property == Property::IconTranslate || property == Property::TextTranslate) { Error error; - optional<PropertyValue<std::array<float, 2>>> typedValue = convert<PropertyValue<std::array<float, 2>>>(value, error, false, false); + optional<PropertyValue<std::array<float, 2>>> typedValue = + convert<PropertyValue<std::array<float, 2>>>(value, error, false, false); if (!typedValue) { return error; } @@ -1351,7 +1352,8 @@ optional<Error> SymbolLayer::setPaintProperty(const std::string& name, const Con if (property == Property::IconTranslateAnchor || property == Property::TextTranslateAnchor) { Error error; - optional<PropertyValue<TranslateAnchorType>> typedValue = convert<PropertyValue<TranslateAnchorType>>(value, error, false, false); + optional<PropertyValue<TranslateAnchorType>> typedValue = + convert<PropertyValue<TranslateAnchorType>>(value, error, false, false); if (!typedValue) { return error; } @@ -1665,7 +1667,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::IconAnchor || property == Property::TextAnchor) { Error error; - optional<PropertyValue<SymbolAnchorType>> typedValue = convert<PropertyValue<SymbolAnchorType>>(value, error, true, false); + optional<PropertyValue<SymbolAnchorType>> typedValue = + convert<PropertyValue<SymbolAnchorType>>(value, error, true, false); if (!typedValue) { return error; } @@ -1684,7 +1687,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::IconImage) { Error error; - optional<PropertyValue<std::string>> typedValue = convert<PropertyValue<std::string>>(value, error, true, true); + optional<PropertyValue<expression::Image>> typedValue = + convert<PropertyValue<expression::Image>>(value, error, true, true); if (!typedValue) { return error; } @@ -1696,7 +1700,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::IconOffset || property == Property::TextOffset) { Error error; - optional<PropertyValue<std::array<float, 2>>> typedValue = convert<PropertyValue<std::array<float, 2>>>(value, error, true, false); + optional<PropertyValue<std::array<float, 2>>> typedValue = + convert<PropertyValue<std::array<float, 2>>>(value, error, true, false); if (!typedValue) { return error; } @@ -1827,7 +1832,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::IconTextFit) { Error error; - optional<PropertyValue<IconTextFitType>> typedValue = convert<PropertyValue<IconTextFitType>>(value, error, false, false); + optional<PropertyValue<IconTextFitType>> typedValue = + convert<PropertyValue<IconTextFitType>>(value, error, false, false); if (!typedValue) { return error; } @@ -1839,7 +1845,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::IconTextFitPadding) { Error error; - optional<PropertyValue<std::array<float, 4>>> typedValue = convert<PropertyValue<std::array<float, 4>>>(value, error, false, false); + optional<PropertyValue<std::array<float, 4>>> typedValue = + convert<PropertyValue<std::array<float, 4>>>(value, error, false, false); if (!typedValue) { return error; } @@ -1851,7 +1858,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::SymbolPlacement) { Error error; - optional<PropertyValue<SymbolPlacementType>> typedValue = convert<PropertyValue<SymbolPlacementType>>(value, error, false, false); + optional<PropertyValue<SymbolPlacementType>> typedValue = + convert<PropertyValue<SymbolPlacementType>>(value, error, false, false); if (!typedValue) { return error; } @@ -1863,7 +1871,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::SymbolZOrder) { Error error; - optional<PropertyValue<SymbolZOrderType>> typedValue = convert<PropertyValue<SymbolZOrderType>>(value, error, false, false); + optional<PropertyValue<SymbolZOrderType>> typedValue = + convert<PropertyValue<SymbolZOrderType>>(value, error, false, false); if (!typedValue) { return error; } @@ -1875,7 +1884,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::TextField) { Error error; - optional<PropertyValue<expression::Formatted>> typedValue = convert<PropertyValue<expression::Formatted>>(value, error, true, true); + optional<PropertyValue<expression::Formatted>> typedValue = + convert<PropertyValue<expression::Formatted>>(value, error, true, true); if (!typedValue) { return error; } @@ -1887,7 +1897,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::TextFont) { Error error; - optional<PropertyValue<std::vector<std::string>>> typedValue = convert<PropertyValue<std::vector<std::string>>>(value, error, true, false); + optional<PropertyValue<std::vector<std::string>>> typedValue = + convert<PropertyValue<std::vector<std::string>>>(value, error, true, false); if (!typedValue) { return error; } @@ -1911,7 +1922,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::TextTransform) { Error error; - optional<PropertyValue<TextTransformType>> typedValue = convert<PropertyValue<TextTransformType>>(value, error, true, false); + optional<PropertyValue<TextTransformType>> typedValue = + convert<PropertyValue<TextTransformType>>(value, error, true, false); if (!typedValue) { return error; } @@ -1923,7 +1935,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::TextVariableAnchor) { Error error; - optional<PropertyValue<std::vector<TextVariableAnchorType>>> typedValue = convert<PropertyValue<std::vector<TextVariableAnchorType>>>(value, error, false, false); + optional<PropertyValue<std::vector<TextVariableAnchorType>>> typedValue = + convert<PropertyValue<std::vector<TextVariableAnchorType>>>(value, error, false, false); if (!typedValue) { return error; } @@ -1935,7 +1948,8 @@ optional<Error> SymbolLayer::setLayoutProperty(const std::string& name, const Co if (property == Property::TextWritingMode) { Error error; - optional<PropertyValue<std::vector<TextWritingModeType>>> typedValue = convert<PropertyValue<std::vector<TextWritingModeType>>>(value, error, false, false); + optional<PropertyValue<std::vector<TextWritingModeType>>> typedValue = + convert<PropertyValue<std::vector<TextWritingModeType>>>(value, error, false, false); if (!typedValue) { return error; } |