// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #include #include #include #include #include #include #include #include #include #include namespace mbgl { namespace style { // static const LayerTypeInfo* SymbolLayer::Impl::staticTypeInfo() noexcept { const static LayerTypeInfo typeInfo {"symbol", LayerTypeInfo::Source::Required, LayerTypeInfo::Pass3D::NotRequired, LayerTypeInfo::Layout::Required, LayerTypeInfo::FadingTiles::Required, LayerTypeInfo::CrossTileIndex::Required }; return &typeInfo; } SymbolLayer::SymbolLayer(const std::string& layerID, const std::string& sourceID) : Layer(makeMutable(layerID, sourceID)) { } SymbolLayer::SymbolLayer(Immutable impl_) : Layer(std::move(impl_)) { } SymbolLayer::~SymbolLayer() = default; const SymbolLayer::Impl& SymbolLayer::impl() const { return static_cast(*baseImpl); } Mutable SymbolLayer::mutableImpl() const { return makeMutable(impl()); } std::unique_ptr SymbolLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; impl_->paint = SymbolPaintProperties::Transitionable(); return std::make_unique(std::move(impl_)); } void SymbolLayer::Impl::stringifyLayout(rapidjson::Writer& writer) const { layout.stringify(writer); } // Layout properties PropertyValue SymbolLayer::getDefaultIconAllowOverlap() { return IconAllowOverlap::defaultValue(); } const PropertyValue& SymbolLayer::getIconAllowOverlap() const { return impl().layout.get(); } void SymbolLayer::setIconAllowOverlap(const PropertyValue& value) { if (value == getIconAllowOverlap()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconAnchor() { return IconAnchor::defaultValue(); } const PropertyValue& SymbolLayer::getIconAnchor() const { return impl().layout.get(); } void SymbolLayer::setIconAnchor(const PropertyValue& value) { if (value == getIconAnchor()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconIgnorePlacement() { return IconIgnorePlacement::defaultValue(); } const PropertyValue& SymbolLayer::getIconIgnorePlacement() const { return impl().layout.get(); } void SymbolLayer::setIconIgnorePlacement(const PropertyValue& value) { if (value == getIconIgnorePlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconImage() { return IconImage::defaultValue(); } const PropertyValue& SymbolLayer::getIconImage() const { return impl().layout.get(); } void SymbolLayer::setIconImage(const PropertyValue& value) { if (value == getIconImage()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconKeepUpright() { return IconKeepUpright::defaultValue(); } const PropertyValue& SymbolLayer::getIconKeepUpright() const { return impl().layout.get(); } void SymbolLayer::setIconKeepUpright(const PropertyValue& value) { if (value == getIconKeepUpright()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultIconOffset() { return IconOffset::defaultValue(); } const PropertyValue>& SymbolLayer::getIconOffset() const { return impl().layout.get(); } void SymbolLayer::setIconOffset(const PropertyValue>& value) { if (value == getIconOffset()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconOptional() { return IconOptional::defaultValue(); } const PropertyValue& SymbolLayer::getIconOptional() const { return impl().layout.get(); } void SymbolLayer::setIconOptional(const PropertyValue& value) { if (value == getIconOptional()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconPadding() { return IconPadding::defaultValue(); } const PropertyValue& SymbolLayer::getIconPadding() const { return impl().layout.get(); } void SymbolLayer::setIconPadding(const PropertyValue& value) { if (value == getIconPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconPitchAlignment() { return IconPitchAlignment::defaultValue(); } const PropertyValue& SymbolLayer::getIconPitchAlignment() const { return impl().layout.get(); } void SymbolLayer::setIconPitchAlignment(const PropertyValue& value) { if (value == getIconPitchAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconRotate() { return IconRotate::defaultValue(); } const PropertyValue& SymbolLayer::getIconRotate() const { return impl().layout.get(); } void SymbolLayer::setIconRotate(const PropertyValue& value) { if (value == getIconRotate()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconRotationAlignment() { return IconRotationAlignment::defaultValue(); } const PropertyValue& SymbolLayer::getIconRotationAlignment() const { return impl().layout.get(); } void SymbolLayer::setIconRotationAlignment(const PropertyValue& value) { if (value == getIconRotationAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconSize() { return IconSize::defaultValue(); } const PropertyValue& SymbolLayer::getIconSize() const { return impl().layout.get(); } void SymbolLayer::setIconSize(const PropertyValue& value) { if (value == getIconSize()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconTextFit() { return IconTextFit::defaultValue(); } const PropertyValue& SymbolLayer::getIconTextFit() const { return impl().layout.get(); } void SymbolLayer::setIconTextFit(const PropertyValue& value) { if (value == getIconTextFit()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultIconTextFitPadding() { return IconTextFitPadding::defaultValue(); } const PropertyValue>& SymbolLayer::getIconTextFitPadding() const { return impl().layout.get(); } void SymbolLayer::setIconTextFitPadding(const PropertyValue>& value) { if (value == getIconTextFitPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolAvoidEdges() { return SymbolAvoidEdges::defaultValue(); } const PropertyValue& SymbolLayer::getSymbolAvoidEdges() const { return impl().layout.get(); } void SymbolLayer::setSymbolAvoidEdges(const PropertyValue& value) { if (value == getSymbolAvoidEdges()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolPlacement() { return SymbolPlacement::defaultValue(); } const PropertyValue& SymbolLayer::getSymbolPlacement() const { return impl().layout.get(); } void SymbolLayer::setSymbolPlacement(const PropertyValue& value) { if (value == getSymbolPlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolSortKey() { return SymbolSortKey::defaultValue(); } const PropertyValue& SymbolLayer::getSymbolSortKey() const { return impl().layout.get(); } void SymbolLayer::setSymbolSortKey(const PropertyValue& value) { if (value == getSymbolSortKey()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolSpacing() { return SymbolSpacing::defaultValue(); } const PropertyValue& SymbolLayer::getSymbolSpacing() const { return impl().layout.get(); } void SymbolLayer::setSymbolSpacing(const PropertyValue& value) { if (value == getSymbolSpacing()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolZOrder() { return SymbolZOrder::defaultValue(); } const PropertyValue& SymbolLayer::getSymbolZOrder() const { return impl().layout.get(); } void SymbolLayer::setSymbolZOrder(const PropertyValue& value) { if (value == getSymbolZOrder()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextAllowOverlap() { return TextAllowOverlap::defaultValue(); } const PropertyValue& SymbolLayer::getTextAllowOverlap() const { return impl().layout.get(); } void SymbolLayer::setTextAllowOverlap(const PropertyValue& value) { if (value == getTextAllowOverlap()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextAnchor() { return TextAnchor::defaultValue(); } const PropertyValue& SymbolLayer::getTextAnchor() const { return impl().layout.get(); } void SymbolLayer::setTextAnchor(const PropertyValue& value) { if (value == getTextAnchor()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextField() { return TextField::defaultValue(); } const PropertyValue& SymbolLayer::getTextField() const { return impl().layout.get(); } void SymbolLayer::setTextField(const PropertyValue& value) { if (value == getTextField()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultTextFont() { return TextFont::defaultValue(); } const PropertyValue>& SymbolLayer::getTextFont() const { return impl().layout.get(); } void SymbolLayer::setTextFont(const PropertyValue>& value) { if (value == getTextFont()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextIgnorePlacement() { return TextIgnorePlacement::defaultValue(); } const PropertyValue& SymbolLayer::getTextIgnorePlacement() const { return impl().layout.get(); } void SymbolLayer::setTextIgnorePlacement(const PropertyValue& value) { if (value == getTextIgnorePlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextJustify() { return TextJustify::defaultValue(); } const PropertyValue& SymbolLayer::getTextJustify() const { return impl().layout.get(); } void SymbolLayer::setTextJustify(const PropertyValue& value) { if (value == getTextJustify()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextKeepUpright() { return TextKeepUpright::defaultValue(); } const PropertyValue& SymbolLayer::getTextKeepUpright() const { return impl().layout.get(); } void SymbolLayer::setTextKeepUpright(const PropertyValue& value) { if (value == getTextKeepUpright()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextLetterSpacing() { return TextLetterSpacing::defaultValue(); } const PropertyValue& SymbolLayer::getTextLetterSpacing() const { return impl().layout.get(); } void SymbolLayer::setTextLetterSpacing(const PropertyValue& value) { if (value == getTextLetterSpacing()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextLineHeight() { return TextLineHeight::defaultValue(); } const PropertyValue& SymbolLayer::getTextLineHeight() const { return impl().layout.get(); } void SymbolLayer::setTextLineHeight(const PropertyValue& value) { if (value == getTextLineHeight()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextMaxAngle() { return TextMaxAngle::defaultValue(); } const PropertyValue& SymbolLayer::getTextMaxAngle() const { return impl().layout.get(); } void SymbolLayer::setTextMaxAngle(const PropertyValue& value) { if (value == getTextMaxAngle()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextMaxWidth() { return TextMaxWidth::defaultValue(); } const PropertyValue& SymbolLayer::getTextMaxWidth() const { return impl().layout.get(); } void SymbolLayer::setTextMaxWidth(const PropertyValue& value) { if (value == getTextMaxWidth()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultTextOffset() { return TextOffset::defaultValue(); } const PropertyValue>& SymbolLayer::getTextOffset() const { return impl().layout.get(); } void SymbolLayer::setTextOffset(const PropertyValue>& value) { if (value == getTextOffset()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextOptional() { return TextOptional::defaultValue(); } const PropertyValue& SymbolLayer::getTextOptional() const { return impl().layout.get(); } void SymbolLayer::setTextOptional(const PropertyValue& value) { if (value == getTextOptional()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextPadding() { return TextPadding::defaultValue(); } const PropertyValue& SymbolLayer::getTextPadding() const { return impl().layout.get(); } void SymbolLayer::setTextPadding(const PropertyValue& value) { if (value == getTextPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextPitchAlignment() { return TextPitchAlignment::defaultValue(); } const PropertyValue& SymbolLayer::getTextPitchAlignment() const { return impl().layout.get(); } void SymbolLayer::setTextPitchAlignment(const PropertyValue& value) { if (value == getTextPitchAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextRadialOffset() { return TextRadialOffset::defaultValue(); } const PropertyValue& SymbolLayer::getTextRadialOffset() const { return impl().layout.get(); } void SymbolLayer::setTextRadialOffset(const PropertyValue& value) { if (value == getTextRadialOffset()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextRotate() { return TextRotate::defaultValue(); } const PropertyValue& SymbolLayer::getTextRotate() const { return impl().layout.get(); } void SymbolLayer::setTextRotate(const PropertyValue& value) { if (value == getTextRotate()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextRotationAlignment() { return TextRotationAlignment::defaultValue(); } const PropertyValue& SymbolLayer::getTextRotationAlignment() const { return impl().layout.get(); } void SymbolLayer::setTextRotationAlignment(const PropertyValue& value) { if (value == getTextRotationAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextSize() { return TextSize::defaultValue(); } const PropertyValue& SymbolLayer::getTextSize() const { return impl().layout.get(); } void SymbolLayer::setTextSize(const PropertyValue& value) { if (value == getTextSize()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextTransform() { return TextTransform::defaultValue(); } const PropertyValue& SymbolLayer::getTextTransform() const { return impl().layout.get(); } void SymbolLayer::setTextTransform(const PropertyValue& value) { if (value == getTextTransform()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultTextVariableAnchor() { return TextVariableAnchor::defaultValue(); } const PropertyValue>& SymbolLayer::getTextVariableAnchor() const { return impl().layout.get(); } void SymbolLayer::setTextVariableAnchor(const PropertyValue>& value) { if (value == getTextVariableAnchor()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } // Paint properties PropertyValue SymbolLayer::getDefaultIconColor() { return { Color::black() }; } const PropertyValue& SymbolLayer::getIconColor() const { return impl().paint.template get().value; } void SymbolLayer::setIconColor(const PropertyValue& value) { if (value == getIconColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconColorTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultIconHaloBlur() { return { 0 }; } const PropertyValue& SymbolLayer::getIconHaloBlur() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloBlur(const PropertyValue& value) { if (value == getIconHaloBlur()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloBlurTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultIconHaloColor() { return { {} }; } const PropertyValue& SymbolLayer::getIconHaloColor() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloColor(const PropertyValue& value) { if (value == getIconHaloColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloColorTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultIconHaloWidth() { return { 0 }; } const PropertyValue& SymbolLayer::getIconHaloWidth() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloWidth(const PropertyValue& value) { if (value == getIconHaloWidth()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloWidthTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultIconOpacity() { return { 1 }; } const PropertyValue& SymbolLayer::getIconOpacity() const { return impl().paint.template get().value; } void SymbolLayer::setIconOpacity(const PropertyValue& value) { if (value == getIconOpacity()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconOpacityTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconOpacityTransition() const { return impl().paint.template get().options; } PropertyValue> SymbolLayer::getDefaultIconTranslate() { return { {{ 0, 0 }} }; } const PropertyValue>& SymbolLayer::getIconTranslate() const { return impl().paint.template get().value; } void SymbolLayer::setIconTranslate(const PropertyValue>& value) { if (value == getIconTranslate()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconTranslateTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconTranslateTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultIconTranslateAnchor() { return { TranslateAnchorType::Map }; } const PropertyValue& SymbolLayer::getIconTranslateAnchor() const { return impl().paint.template get().value; } void SymbolLayer::setIconTranslateAnchor(const PropertyValue& value) { if (value == getIconTranslateAnchor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconTranslateAnchorTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextColor() { return { Color::black() }; } const PropertyValue& SymbolLayer::getTextColor() const { return impl().paint.template get().value; } void SymbolLayer::setTextColor(const PropertyValue& value) { if (value == getTextColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextColorTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextHaloBlur() { return { 0 }; } const PropertyValue& SymbolLayer::getTextHaloBlur() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloBlur(const PropertyValue& value) { if (value == getTextHaloBlur()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloBlurTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextHaloColor() { return { {} }; } const PropertyValue& SymbolLayer::getTextHaloColor() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloColor(const PropertyValue& value) { if (value == getTextHaloColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloColorTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextHaloWidth() { return { 0 }; } const PropertyValue& SymbolLayer::getTextHaloWidth() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloWidth(const PropertyValue& value) { if (value == getTextHaloWidth()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloWidthTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextOpacity() { return { 1 }; } const PropertyValue& SymbolLayer::getTextOpacity() const { return impl().paint.template get().value; } void SymbolLayer::setTextOpacity(const PropertyValue& value) { if (value == getTextOpacity()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextOpacityTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextOpacityTransition() const { return impl().paint.template get().options; } PropertyValue> SymbolLayer::getDefaultTextTranslate() { return { {{ 0, 0 }} }; } const PropertyValue>& SymbolLayer::getTextTranslate() const { return impl().paint.template get().value; } void SymbolLayer::setTextTranslate(const PropertyValue>& value) { if (value == getTextTranslate()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextTranslateTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextTranslateTransition() const { return impl().paint.template get().options; } PropertyValue SymbolLayer::getDefaultTextTranslateAnchor() { return { TranslateAnchorType::Map }; } const PropertyValue& SymbolLayer::getTextTranslateAnchor() const { return impl().paint.template get().value; } void SymbolLayer::setTextTranslateAnchor(const PropertyValue& value) { if (value == getTextTranslateAnchor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextTranslateAnchorTransition() const { return impl().paint.template get().options; } using namespace conversion; optional SymbolLayer::setPaintProperty(const std::string& name, const Convertible& value) { enum class Property : uint8_t { IconColor, IconHaloBlur, IconHaloColor, IconHaloWidth, IconOpacity, IconTranslate, IconTranslateAnchor, TextColor, TextHaloBlur, TextHaloColor, TextHaloWidth, TextOpacity, TextTranslate, TextTranslateAnchor, IconColorTransition, IconHaloBlurTransition, IconHaloColorTransition, IconHaloWidthTransition, IconOpacityTransition, IconTranslateTransition, IconTranslateAnchorTransition, TextColorTransition, TextHaloBlurTransition, TextHaloColorTransition, TextHaloWidthTransition, TextOpacityTransition, TextTranslateTransition, TextTranslateAnchorTransition, }; MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map({ { "icon-color", static_cast(Property::IconColor) }, { "icon-halo-blur", static_cast(Property::IconHaloBlur) }, { "icon-halo-color", static_cast(Property::IconHaloColor) }, { "icon-halo-width", static_cast(Property::IconHaloWidth) }, { "icon-opacity", static_cast(Property::IconOpacity) }, { "icon-translate", static_cast(Property::IconTranslate) }, { "icon-translate-anchor", static_cast(Property::IconTranslateAnchor) }, { "text-color", static_cast(Property::TextColor) }, { "text-halo-blur", static_cast(Property::TextHaloBlur) }, { "text-halo-color", static_cast(Property::TextHaloColor) }, { "text-halo-width", static_cast(Property::TextHaloWidth) }, { "text-opacity", static_cast(Property::TextOpacity) }, { "text-translate", static_cast(Property::TextTranslate) }, { "text-translate-anchor", static_cast(Property::TextTranslateAnchor) }, { "icon-color-transition", static_cast(Property::IconColorTransition) }, { "icon-halo-blur-transition", static_cast(Property::IconHaloBlurTransition) }, { "icon-halo-color-transition", static_cast(Property::IconHaloColorTransition) }, { "icon-halo-width-transition", static_cast(Property::IconHaloWidthTransition) }, { "icon-opacity-transition", static_cast(Property::IconOpacityTransition) }, { "icon-translate-transition", static_cast(Property::IconTranslateTransition) }, { "icon-translate-anchor-transition", static_cast(Property::IconTranslateAnchorTransition) }, { "text-color-transition", static_cast(Property::TextColorTransition) }, { "text-halo-blur-transition", static_cast(Property::TextHaloBlurTransition) }, { "text-halo-color-transition", static_cast(Property::TextHaloColorTransition) }, { "text-halo-width-transition", static_cast(Property::TextHaloWidthTransition) }, { "text-opacity-transition", static_cast(Property::TextOpacityTransition) }, { "text-translate-transition", static_cast(Property::TextTranslateTransition) }, { "text-translate-anchor-transition", static_cast(Property::TextTranslateAnchorTransition) } }); const auto it = properties.find(name.c_str()); if (it == properties.end()) { return Error { "layer doesn't support this property" }; } auto property = static_cast(it->second); if (property == Property::IconColor || property == Property::IconHaloColor || property == Property::TextColor || property == Property::TextHaloColor) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconColor) { setIconColor(*typedValue); return nullopt; } if (property == Property::IconHaloColor) { setIconHaloColor(*typedValue); return nullopt; } if (property == Property::TextColor) { setTextColor(*typedValue); return nullopt; } if (property == Property::TextHaloColor) { setTextHaloColor(*typedValue); return nullopt; } } if (property == Property::IconHaloBlur || property == Property::IconHaloWidth || property == Property::IconOpacity || property == Property::TextHaloBlur || property == Property::TextHaloWidth || property == Property::TextOpacity) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconHaloBlur) { setIconHaloBlur(*typedValue); return nullopt; } if (property == Property::IconHaloWidth) { setIconHaloWidth(*typedValue); return nullopt; } if (property == Property::IconOpacity) { setIconOpacity(*typedValue); return nullopt; } if (property == Property::TextHaloBlur) { setTextHaloBlur(*typedValue); return nullopt; } if (property == Property::TextHaloWidth) { setTextHaloWidth(*typedValue); return nullopt; } if (property == Property::TextOpacity) { setTextOpacity(*typedValue); return nullopt; } } if (property == Property::IconTranslate || property == Property::TextTranslate) { Error error; optional>> typedValue = convert>>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconTranslate) { setIconTranslate(*typedValue); return nullopt; } if (property == Property::TextTranslate) { setTextTranslate(*typedValue); return nullopt; } } if (property == Property::IconTranslateAnchor || property == Property::TextTranslateAnchor) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconTranslateAnchor) { setIconTranslateAnchor(*typedValue); return nullopt; } if (property == Property::TextTranslateAnchor) { setTextTranslateAnchor(*typedValue); return nullopt; } } Error error; optional transition = convert(value, error); if (!transition) { return error; } if (property == Property::IconColorTransition) { setIconColorTransition(*transition); return nullopt; } if (property == Property::IconHaloBlurTransition) { setIconHaloBlurTransition(*transition); return nullopt; } if (property == Property::IconHaloColorTransition) { setIconHaloColorTransition(*transition); return nullopt; } if (property == Property::IconHaloWidthTransition) { setIconHaloWidthTransition(*transition); return nullopt; } if (property == Property::IconOpacityTransition) { setIconOpacityTransition(*transition); return nullopt; } if (property == Property::IconTranslateTransition) { setIconTranslateTransition(*transition); return nullopt; } if (property == Property::IconTranslateAnchorTransition) { setIconTranslateAnchorTransition(*transition); return nullopt; } if (property == Property::TextColorTransition) { setTextColorTransition(*transition); return nullopt; } if (property == Property::TextHaloBlurTransition) { setTextHaloBlurTransition(*transition); return nullopt; } if (property == Property::TextHaloColorTransition) { setTextHaloColorTransition(*transition); return nullopt; } if (property == Property::TextHaloWidthTransition) { setTextHaloWidthTransition(*transition); return nullopt; } if (property == Property::TextOpacityTransition) { setTextOpacityTransition(*transition); return nullopt; } if (property == Property::TextTranslateTransition) { setTextTranslateTransition(*transition); return nullopt; } if (property == Property::TextTranslateAnchorTransition) { setTextTranslateAnchorTransition(*transition); return nullopt; } return Error { "layer doesn't support this property" }; } optional SymbolLayer::setLayoutProperty(const std::string& name, const Convertible& value) { if (name == "visibility") { return Layer::setVisibility(value); } enum class Property { IconAllowOverlap, IconAnchor, IconIgnorePlacement, IconImage, IconKeepUpright, IconOffset, IconOptional, IconPadding, IconPitchAlignment, IconRotate, IconRotationAlignment, IconSize, IconTextFit, IconTextFitPadding, SymbolAvoidEdges, SymbolPlacement, SymbolSortKey, SymbolSpacing, SymbolZOrder, TextAllowOverlap, TextAnchor, TextField, TextFont, TextIgnorePlacement, TextJustify, TextKeepUpright, TextLetterSpacing, TextLineHeight, TextMaxAngle, TextMaxWidth, TextOffset, TextOptional, TextPadding, TextPitchAlignment, TextRadialOffset, TextRotate, TextRotationAlignment, TextSize, TextTransform, TextVariableAnchor, }; MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map({ { "icon-allow-overlap", static_cast(Property::IconAllowOverlap) }, { "icon-anchor", static_cast(Property::IconAnchor) }, { "icon-ignore-placement", static_cast(Property::IconIgnorePlacement) }, { "icon-image", static_cast(Property::IconImage) }, { "icon-keep-upright", static_cast(Property::IconKeepUpright) }, { "icon-offset", static_cast(Property::IconOffset) }, { "icon-optional", static_cast(Property::IconOptional) }, { "icon-padding", static_cast(Property::IconPadding) }, { "icon-pitch-alignment", static_cast(Property::IconPitchAlignment) }, { "icon-rotate", static_cast(Property::IconRotate) }, { "icon-rotation-alignment", static_cast(Property::IconRotationAlignment) }, { "icon-size", static_cast(Property::IconSize) }, { "icon-text-fit", static_cast(Property::IconTextFit) }, { "icon-text-fit-padding", static_cast(Property::IconTextFitPadding) }, { "symbol-avoid-edges", static_cast(Property::SymbolAvoidEdges) }, { "symbol-placement", static_cast(Property::SymbolPlacement) }, { "symbol-sort-key", static_cast(Property::SymbolSortKey) }, { "symbol-spacing", static_cast(Property::SymbolSpacing) }, { "symbol-z-order", static_cast(Property::SymbolZOrder) }, { "text-allow-overlap", static_cast(Property::TextAllowOverlap) }, { "text-anchor", static_cast(Property::TextAnchor) }, { "text-field", static_cast(Property::TextField) }, { "text-font", static_cast(Property::TextFont) }, { "text-ignore-placement", static_cast(Property::TextIgnorePlacement) }, { "text-justify", static_cast(Property::TextJustify) }, { "text-keep-upright", static_cast(Property::TextKeepUpright) }, { "text-letter-spacing", static_cast(Property::TextLetterSpacing) }, { "text-line-height", static_cast(Property::TextLineHeight) }, { "text-max-angle", static_cast(Property::TextMaxAngle) }, { "text-max-width", static_cast(Property::TextMaxWidth) }, { "text-offset", static_cast(Property::TextOffset) }, { "text-optional", static_cast(Property::TextOptional) }, { "text-padding", static_cast(Property::TextPadding) }, { "text-pitch-alignment", static_cast(Property::TextPitchAlignment) }, { "text-radial-offset", static_cast(Property::TextRadialOffset) }, { "text-rotate", static_cast(Property::TextRotate) }, { "text-rotation-alignment", static_cast(Property::TextRotationAlignment) }, { "text-size", static_cast(Property::TextSize) }, { "text-transform", static_cast(Property::TextTransform) }, { "text-variable-anchor", static_cast(Property::TextVariableAnchor) } }); const auto it = properties.find(name.c_str()); if (it == properties.end()) { return Error { "layer doesn't support this property" }; } auto property = static_cast(it->second); if (property == Property::IconAllowOverlap || property == Property::IconIgnorePlacement || property == Property::IconKeepUpright || property == Property::IconOptional || property == Property::SymbolAvoidEdges || property == Property::TextAllowOverlap || property == Property::TextIgnorePlacement || property == Property::TextKeepUpright || property == Property::TextOptional) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconAllowOverlap) { setIconAllowOverlap(*typedValue); return nullopt; } if (property == Property::IconIgnorePlacement) { setIconIgnorePlacement(*typedValue); return nullopt; } if (property == Property::IconKeepUpright) { setIconKeepUpright(*typedValue); return nullopt; } if (property == Property::IconOptional) { setIconOptional(*typedValue); return nullopt; } if (property == Property::SymbolAvoidEdges) { setSymbolAvoidEdges(*typedValue); return nullopt; } if (property == Property::TextAllowOverlap) { setTextAllowOverlap(*typedValue); return nullopt; } if (property == Property::TextIgnorePlacement) { setTextIgnorePlacement(*typedValue); return nullopt; } if (property == Property::TextKeepUpright) { setTextKeepUpright(*typedValue); return nullopt; } if (property == Property::TextOptional) { setTextOptional(*typedValue); return nullopt; } } if (property == Property::IconAnchor || property == Property::TextAnchor) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconAnchor) { setIconAnchor(*typedValue); return nullopt; } if (property == Property::TextAnchor) { setTextAnchor(*typedValue); return nullopt; } } if (property == Property::IconImage) { Error error; optional> typedValue = convert>(value, error, true, true); if (!typedValue) { return error; } setIconImage(*typedValue); return nullopt; } if (property == Property::IconOffset || property == Property::TextOffset) { Error error; optional>> typedValue = convert>>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconOffset) { setIconOffset(*typedValue); return nullopt; } if (property == Property::TextOffset) { setTextOffset(*typedValue); return nullopt; } } if (property == Property::IconPadding || property == Property::SymbolSpacing || property == Property::TextLineHeight || property == Property::TextMaxAngle || property == Property::TextPadding) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconPadding) { setIconPadding(*typedValue); return nullopt; } if (property == Property::SymbolSpacing) { setSymbolSpacing(*typedValue); return nullopt; } if (property == Property::TextLineHeight) { setTextLineHeight(*typedValue); return nullopt; } if (property == Property::TextMaxAngle) { setTextMaxAngle(*typedValue); return nullopt; } if (property == Property::TextPadding) { setTextPadding(*typedValue); return nullopt; } } if (property == Property::IconPitchAlignment || property == Property::IconRotationAlignment || property == Property::TextPitchAlignment || property == Property::TextRotationAlignment) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconPitchAlignment) { setIconPitchAlignment(*typedValue); return nullopt; } if (property == Property::IconRotationAlignment) { setIconRotationAlignment(*typedValue); return nullopt; } if (property == Property::TextPitchAlignment) { setTextPitchAlignment(*typedValue); return nullopt; } if (property == Property::TextRotationAlignment) { setTextRotationAlignment(*typedValue); return nullopt; } } if (property == Property::IconRotate || property == Property::IconSize || property == Property::SymbolSortKey || property == Property::TextLetterSpacing || property == Property::TextMaxWidth || property == Property::TextRadialOffset || property == Property::TextRotate || property == Property::TextSize) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconRotate) { setIconRotate(*typedValue); return nullopt; } if (property == Property::IconSize) { setIconSize(*typedValue); return nullopt; } if (property == Property::SymbolSortKey) { setSymbolSortKey(*typedValue); return nullopt; } if (property == Property::TextLetterSpacing) { setTextLetterSpacing(*typedValue); return nullopt; } if (property == Property::TextMaxWidth) { setTextMaxWidth(*typedValue); return nullopt; } if (property == Property::TextRadialOffset) { setTextRadialOffset(*typedValue); return nullopt; } if (property == Property::TextRotate) { setTextRotate(*typedValue); return nullopt; } if (property == Property::TextSize) { setTextSize(*typedValue); return nullopt; } } if (property == Property::IconTextFit) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setIconTextFit(*typedValue); return nullopt; } if (property == Property::IconTextFitPadding) { Error error; optional>> typedValue = convert>>(value, error, false, false); if (!typedValue) { return error; } setIconTextFitPadding(*typedValue); return nullopt; } if (property == Property::SymbolPlacement) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setSymbolPlacement(*typedValue); return nullopt; } if (property == Property::SymbolZOrder) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setSymbolZOrder(*typedValue); return nullopt; } if (property == Property::TextField) { Error error; optional> typedValue = convert>(value, error, true, true); if (!typedValue) { return error; } setTextField(*typedValue); return nullopt; } if (property == Property::TextFont) { Error error; optional>> typedValue = convert>>(value, error, true, false); if (!typedValue) { return error; } setTextFont(*typedValue); return nullopt; } if (property == Property::TextJustify) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } setTextJustify(*typedValue); return nullopt; } if (property == Property::TextTransform) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } setTextTransform(*typedValue); return nullopt; } if (property == Property::TextVariableAnchor) { Error error; optional>> typedValue = convert>>(value, error, false, false); if (!typedValue) { return error; } setTextVariableAnchor(*typedValue); return nullopt; } return Error { "layer doesn't support this property" }; } Mutable SymbolLayer::mutableBaseImpl() const { return staticMutableCast(mutableImpl()); } } // namespace style } // namespace mbgl