// 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 { SymbolLayer::SymbolLayer(const std::string& layerID, const std::string& sourceID) : Layer(makeMutable(LayerType::Symbol, 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); } // Source const std::string& SymbolLayer::getSourceID() const { return impl().source; } void SymbolLayer::setSourceLayer(const std::string& sourceLayer) { auto impl_ = mutableImpl(); impl_->sourceLayer = sourceLayer; baseImpl = std::move(impl_); } const std::string& SymbolLayer::getSourceLayer() const { return impl().sourceLayer; } // Filter void SymbolLayer::setFilter(const Filter& filter) { auto impl_ = mutableImpl(); impl_->filter = filter; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } const Filter& SymbolLayer::getFilter() const { return impl().filter; } // Visibility void SymbolLayer::setVisibility(VisibilityType value) { if (value == getVisibility()) return; auto impl_ = mutableImpl(); impl_->visibility = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } // Zoom range void SymbolLayer::setMinZoom(float minZoom) { auto impl_ = mutableImpl(); impl_->minZoom = minZoom; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void SymbolLayer::setMaxZoom(float maxZoom) { auto impl_ = mutableImpl(); impl_->maxZoom = maxZoom; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } // Layout properties PropertyValue SymbolLayer::getDefaultSymbolPlacement() { return SymbolPlacement::defaultValue(); } PropertyValue SymbolLayer::getSymbolPlacement() const { return impl().layout.get(); } void SymbolLayer::setSymbolPlacement(PropertyValue value) { if (value == getSymbolPlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolSpacing() { return SymbolSpacing::defaultValue(); } PropertyValue SymbolLayer::getSymbolSpacing() const { return impl().layout.get(); } void SymbolLayer::setSymbolSpacing(PropertyValue value) { if (value == getSymbolSpacing()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultSymbolAvoidEdges() { return SymbolAvoidEdges::defaultValue(); } PropertyValue SymbolLayer::getSymbolAvoidEdges() const { return impl().layout.get(); } void SymbolLayer::setSymbolAvoidEdges(PropertyValue value) { if (value == getSymbolAvoidEdges()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconAllowOverlap() { return IconAllowOverlap::defaultValue(); } PropertyValue SymbolLayer::getIconAllowOverlap() const { return impl().layout.get(); } void SymbolLayer::setIconAllowOverlap(PropertyValue value) { if (value == getIconAllowOverlap()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconIgnorePlacement() { return IconIgnorePlacement::defaultValue(); } PropertyValue SymbolLayer::getIconIgnorePlacement() const { return impl().layout.get(); } void SymbolLayer::setIconIgnorePlacement(PropertyValue value) { if (value == getIconIgnorePlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconOptional() { return IconOptional::defaultValue(); } PropertyValue SymbolLayer::getIconOptional() const { return impl().layout.get(); } void SymbolLayer::setIconOptional(PropertyValue value) { if (value == getIconOptional()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconRotationAlignment() { return IconRotationAlignment::defaultValue(); } PropertyValue SymbolLayer::getIconRotationAlignment() const { return impl().layout.get(); } void SymbolLayer::setIconRotationAlignment(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(); } PropertyValue SymbolLayer::getIconSize() const { return impl().layout.get(); } void SymbolLayer::setIconSize(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(); } PropertyValue SymbolLayer::getIconTextFit() const { return impl().layout.get(); } void SymbolLayer::setIconTextFit(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(); } PropertyValue> SymbolLayer::getIconTextFitPadding() const { return impl().layout.get(); } void SymbolLayer::setIconTextFitPadding(PropertyValue> value) { if (value == getIconTextFitPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconImage() { return IconImage::defaultValue(); } PropertyValue SymbolLayer::getIconImage() const { return impl().layout.get(); } void SymbolLayer::setIconImage(PropertyValue value) { if (value == getIconImage()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconRotate() { return IconRotate::defaultValue(); } PropertyValue SymbolLayer::getIconRotate() const { return impl().layout.get(); } void SymbolLayer::setIconRotate(PropertyValue value) { if (value == getIconRotate()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconPadding() { return IconPadding::defaultValue(); } PropertyValue SymbolLayer::getIconPadding() const { return impl().layout.get(); } void SymbolLayer::setIconPadding(PropertyValue value) { if (value == getIconPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconKeepUpright() { return IconKeepUpright::defaultValue(); } PropertyValue SymbolLayer::getIconKeepUpright() const { return impl().layout.get(); } void SymbolLayer::setIconKeepUpright(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(); } PropertyValue> SymbolLayer::getIconOffset() const { return impl().layout.get(); } void SymbolLayer::setIconOffset(PropertyValue> value) { if (value == getIconOffset()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconAnchor() { return IconAnchor::defaultValue(); } PropertyValue SymbolLayer::getIconAnchor() const { return impl().layout.get(); } void SymbolLayer::setIconAnchor(PropertyValue value) { if (value == getIconAnchor()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultIconPitchAlignment() { return IconPitchAlignment::defaultValue(); } PropertyValue SymbolLayer::getIconPitchAlignment() const { return impl().layout.get(); } void SymbolLayer::setIconPitchAlignment(PropertyValue value) { if (value == getIconPitchAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextPitchAlignment() { return TextPitchAlignment::defaultValue(); } PropertyValue SymbolLayer::getTextPitchAlignment() const { return impl().layout.get(); } void SymbolLayer::setTextPitchAlignment(PropertyValue value) { if (value == getTextPitchAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextRotationAlignment() { return TextRotationAlignment::defaultValue(); } PropertyValue SymbolLayer::getTextRotationAlignment() const { return impl().layout.get(); } void SymbolLayer::setTextRotationAlignment(PropertyValue value) { if (value == getTextRotationAlignment()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextField() { return TextField::defaultValue(); } PropertyValue SymbolLayer::getTextField() const { return impl().layout.get(); } void SymbolLayer::setTextField(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(); } PropertyValue> SymbolLayer::getTextFont() const { return impl().layout.get(); } void SymbolLayer::setTextFont(PropertyValue> value) { if (value == getTextFont()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextSize() { return TextSize::defaultValue(); } PropertyValue SymbolLayer::getTextSize() const { return impl().layout.get(); } void SymbolLayer::setTextSize(PropertyValue value) { if (value == getTextSize()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextMaxWidth() { return TextMaxWidth::defaultValue(); } PropertyValue SymbolLayer::getTextMaxWidth() const { return impl().layout.get(); } void SymbolLayer::setTextMaxWidth(PropertyValue value) { if (value == getTextMaxWidth()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextLineHeight() { return TextLineHeight::defaultValue(); } PropertyValue SymbolLayer::getTextLineHeight() const { return impl().layout.get(); } void SymbolLayer::setTextLineHeight(PropertyValue value) { if (value == getTextLineHeight()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextLetterSpacing() { return TextLetterSpacing::defaultValue(); } PropertyValue SymbolLayer::getTextLetterSpacing() const { return impl().layout.get(); } void SymbolLayer::setTextLetterSpacing(PropertyValue value) { if (value == getTextLetterSpacing()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextJustify() { return TextJustify::defaultValue(); } PropertyValue SymbolLayer::getTextJustify() const { return impl().layout.get(); } void SymbolLayer::setTextJustify(PropertyValue value) { if (value == getTextJustify()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextAnchor() { return TextAnchor::defaultValue(); } PropertyValue SymbolLayer::getTextAnchor() const { return impl().layout.get(); } void SymbolLayer::setTextAnchor(PropertyValue value) { if (value == getTextAnchor()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextMaxAngle() { return TextMaxAngle::defaultValue(); } PropertyValue SymbolLayer::getTextMaxAngle() const { return impl().layout.get(); } void SymbolLayer::setTextMaxAngle(PropertyValue value) { if (value == getTextMaxAngle()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextRotate() { return TextRotate::defaultValue(); } PropertyValue SymbolLayer::getTextRotate() const { return impl().layout.get(); } void SymbolLayer::setTextRotate(PropertyValue value) { if (value == getTextRotate()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextPadding() { return TextPadding::defaultValue(); } PropertyValue SymbolLayer::getTextPadding() const { return impl().layout.get(); } void SymbolLayer::setTextPadding(PropertyValue value) { if (value == getTextPadding()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextKeepUpright() { return TextKeepUpright::defaultValue(); } PropertyValue SymbolLayer::getTextKeepUpright() const { return impl().layout.get(); } void SymbolLayer::setTextKeepUpright(PropertyValue value) { if (value == getTextKeepUpright()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextTransform() { return TextTransform::defaultValue(); } PropertyValue SymbolLayer::getTextTransform() const { return impl().layout.get(); } void SymbolLayer::setTextTransform(PropertyValue value) { if (value == getTextTransform()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue> SymbolLayer::getDefaultTextOffset() { return TextOffset::defaultValue(); } PropertyValue> SymbolLayer::getTextOffset() const { return impl().layout.get(); } void SymbolLayer::setTextOffset(PropertyValue> value) { if (value == getTextOffset()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextAllowOverlap() { return TextAllowOverlap::defaultValue(); } PropertyValue SymbolLayer::getTextAllowOverlap() const { return impl().layout.get(); } void SymbolLayer::setTextAllowOverlap(PropertyValue value) { if (value == getTextAllowOverlap()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextIgnorePlacement() { return TextIgnorePlacement::defaultValue(); } PropertyValue SymbolLayer::getTextIgnorePlacement() const { return impl().layout.get(); } void SymbolLayer::setTextIgnorePlacement(PropertyValue value) { if (value == getTextIgnorePlacement()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } PropertyValue SymbolLayer::getDefaultTextOptional() { return TextOptional::defaultValue(); } PropertyValue SymbolLayer::getTextOptional() const { return impl().layout.get(); } void SymbolLayer::setTextOptional(PropertyValue value) { if (value == getTextOptional()) return; auto impl_ = mutableImpl(); impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } // Paint properties PropertyValue SymbolLayer::getDefaultIconOpacity() { return { 1 }; } PropertyValue SymbolLayer::getIconOpacity() const { return impl().paint.template get().value; } void SymbolLayer::setIconOpacity(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::getDefaultIconColor() { return { Color::black() }; } PropertyValue SymbolLayer::getIconColor() const { return impl().paint.template get().value; } void SymbolLayer::setIconColor(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::getDefaultIconHaloColor() { return { {} }; } PropertyValue SymbolLayer::getIconHaloColor() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloColor(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 }; } PropertyValue SymbolLayer::getIconHaloWidth() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloWidth(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::getDefaultIconHaloBlur() { return { 0 }; } PropertyValue SymbolLayer::getIconHaloBlur() const { return impl().paint.template get().value; } void SymbolLayer::setIconHaloBlur(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::getDefaultIconTranslate() { return { {{ 0, 0 }} }; } PropertyValue> SymbolLayer::getIconTranslate() const { return impl().paint.template get().value; } void SymbolLayer::setIconTranslate(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 }; } PropertyValue SymbolLayer::getIconTranslateAnchor() const { return impl().paint.template get().value; } void SymbolLayer::setIconTranslateAnchor(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::getDefaultTextOpacity() { return { 1 }; } PropertyValue SymbolLayer::getTextOpacity() const { return impl().paint.template get().value; } void SymbolLayer::setTextOpacity(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::getDefaultTextColor() { return { Color::black() }; } PropertyValue SymbolLayer::getTextColor() const { return impl().paint.template get().value; } void SymbolLayer::setTextColor(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::getDefaultTextHaloColor() { return { {} }; } PropertyValue SymbolLayer::getTextHaloColor() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloColor(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 }; } PropertyValue SymbolLayer::getTextHaloWidth() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloWidth(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::getDefaultTextHaloBlur() { return { 0 }; } PropertyValue SymbolLayer::getTextHaloBlur() const { return impl().paint.template get().value; } void SymbolLayer::setTextHaloBlur(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::getDefaultTextTranslate() { return { {{ 0, 0 }} }; } PropertyValue> SymbolLayer::getTextTranslate() const { return impl().paint.template get().value; } void SymbolLayer::setTextTranslate(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 }; } PropertyValue SymbolLayer::getTextTranslateAnchor() const { return impl().paint.template get().value; } void SymbolLayer::setTextTranslateAnchor(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 { Unknown, IconOpacity, IconColor, IconHaloColor, IconHaloWidth, IconHaloBlur, IconTranslate, IconTranslateAnchor, TextOpacity, TextColor, TextHaloColor, TextHaloWidth, TextHaloBlur, TextTranslate, TextTranslateAnchor, IconOpacityTransition, IconColorTransition, IconHaloColorTransition, IconHaloWidthTransition, IconHaloBlurTransition, IconTranslateTransition, IconTranslateAnchorTransition, TextOpacityTransition, TextColorTransition, TextHaloColorTransition, TextHaloWidthTransition, TextHaloBlurTransition, TextTranslateTransition, TextTranslateAnchorTransition, }; Property property = Property::Unknown; switch (util::hashFNV1a(name.c_str())) { case util::hashFNV1a("icon-opacity"): if (name == "icon-opacity") { property = Property::IconOpacity; } break; case util::hashFNV1a("icon-opacity-transition"): if (name == "icon-opacity-transition") { property = Property::IconOpacityTransition; } break; case util::hashFNV1a("icon-color"): if (name == "icon-color") { property = Property::IconColor; } break; case util::hashFNV1a("icon-color-transition"): if (name == "icon-color-transition") { property = Property::IconColorTransition; } break; case util::hashFNV1a("icon-halo-color"): if (name == "icon-halo-color") { property = Property::IconHaloColor; } break; case util::hashFNV1a("icon-halo-color-transition"): if (name == "icon-halo-color-transition") { property = Property::IconHaloColorTransition; } break; case util::hashFNV1a("icon-halo-width"): if (name == "icon-halo-width") { property = Property::IconHaloWidth; } break; case util::hashFNV1a("icon-halo-width-transition"): if (name == "icon-halo-width-transition") { property = Property::IconHaloWidthTransition; } break; case util::hashFNV1a("icon-halo-blur"): if (name == "icon-halo-blur") { property = Property::IconHaloBlur; } break; case util::hashFNV1a("icon-halo-blur-transition"): if (name == "icon-halo-blur-transition") { property = Property::IconHaloBlurTransition; } break; case util::hashFNV1a("icon-translate"): if (name == "icon-translate") { property = Property::IconTranslate; } break; case util::hashFNV1a("icon-translate-transition"): if (name == "icon-translate-transition") { property = Property::IconTranslateTransition; } break; case util::hashFNV1a("icon-translate-anchor"): if (name == "icon-translate-anchor") { property = Property::IconTranslateAnchor; } break; case util::hashFNV1a("icon-translate-anchor-transition"): if (name == "icon-translate-anchor-transition") { property = Property::IconTranslateAnchorTransition; } break; case util::hashFNV1a("text-opacity"): if (name == "text-opacity") { property = Property::TextOpacity; } break; case util::hashFNV1a("text-opacity-transition"): if (name == "text-opacity-transition") { property = Property::TextOpacityTransition; } break; case util::hashFNV1a("text-color"): if (name == "text-color") { property = Property::TextColor; } break; case util::hashFNV1a("text-color-transition"): if (name == "text-color-transition") { property = Property::TextColorTransition; } break; case util::hashFNV1a("text-halo-color"): if (name == "text-halo-color") { property = Property::TextHaloColor; } break; case util::hashFNV1a("text-halo-color-transition"): if (name == "text-halo-color-transition") { property = Property::TextHaloColorTransition; } break; case util::hashFNV1a("text-halo-width"): if (name == "text-halo-width") { property = Property::TextHaloWidth; } break; case util::hashFNV1a("text-halo-width-transition"): if (name == "text-halo-width-transition") { property = Property::TextHaloWidthTransition; } break; case util::hashFNV1a("text-halo-blur"): if (name == "text-halo-blur") { property = Property::TextHaloBlur; } break; case util::hashFNV1a("text-halo-blur-transition"): if (name == "text-halo-blur-transition") { property = Property::TextHaloBlurTransition; } break; case util::hashFNV1a("text-translate"): if (name == "text-translate") { property = Property::TextTranslate; } break; case util::hashFNV1a("text-translate-transition"): if (name == "text-translate-transition") { property = Property::TextTranslateTransition; } break; case util::hashFNV1a("text-translate-anchor"): if (name == "text-translate-anchor") { property = Property::TextTranslateAnchor; } break; case util::hashFNV1a("text-translate-anchor-transition"): if (name == "text-translate-anchor-transition") { property = Property::TextTranslateAnchorTransition; } break; } if (property == Property::Unknown) { return Error { "layer doesn't support this property" }; } if (property == Property::IconOpacity || property == Property::IconHaloWidth || property == Property::IconHaloBlur || property == Property::TextOpacity || property == Property::TextHaloWidth || property == Property::TextHaloBlur) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconOpacity) { setIconOpacity(*typedValue); return nullopt; } if (property == Property::IconHaloWidth) { setIconHaloWidth(*typedValue); return nullopt; } if (property == Property::IconHaloBlur) { setIconHaloBlur(*typedValue); return nullopt; } if (property == Property::TextOpacity) { setTextOpacity(*typedValue); return nullopt; } if (property == Property::TextHaloWidth) { setTextHaloWidth(*typedValue); return nullopt; } if (property == Property::TextHaloBlur) { setTextHaloBlur(*typedValue); return nullopt; } } 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::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::IconOpacityTransition) { setIconOpacityTransition(*transition); return nullopt; } if (property == Property::IconColorTransition) { setIconColorTransition(*transition); return nullopt; } if (property == Property::IconHaloColorTransition) { setIconHaloColorTransition(*transition); return nullopt; } if (property == Property::IconHaloWidthTransition) { setIconHaloWidthTransition(*transition); return nullopt; } if (property == Property::IconHaloBlurTransition) { setIconHaloBlurTransition(*transition); return nullopt; } if (property == Property::IconTranslateTransition) { setIconTranslateTransition(*transition); return nullopt; } if (property == Property::IconTranslateAnchorTransition) { setIconTranslateAnchorTransition(*transition); return nullopt; } if (property == Property::TextOpacityTransition) { setTextOpacityTransition(*transition); return nullopt; } if (property == Property::TextColorTransition) { setTextColorTransition(*transition); return nullopt; } if (property == Property::TextHaloColorTransition) { setTextHaloColorTransition(*transition); return nullopt; } if (property == Property::TextHaloWidthTransition) { setTextHaloWidthTransition(*transition); return nullopt; } if (property == Property::TextHaloBlurTransition) { setTextHaloBlurTransition(*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 { Unknown, SymbolPlacement, SymbolSpacing, SymbolAvoidEdges, IconAllowOverlap, IconIgnorePlacement, IconOptional, IconRotationAlignment, IconSize, IconTextFit, IconTextFitPadding, IconImage, IconRotate, IconPadding, IconKeepUpright, IconOffset, IconAnchor, IconPitchAlignment, TextPitchAlignment, TextRotationAlignment, TextField, TextFont, TextSize, TextMaxWidth, TextLineHeight, TextLetterSpacing, TextJustify, TextAnchor, TextMaxAngle, TextRotate, TextPadding, TextKeepUpright, TextTransform, TextOffset, TextAllowOverlap, TextIgnorePlacement, TextOptional, }; Property property = Property::Unknown; switch (util::hashFNV1a(name.c_str())) { case util::hashFNV1a("symbol-placement"): if (name == "symbol-placement") { property = Property::SymbolPlacement; } break; case util::hashFNV1a("symbol-spacing"): if (name == "symbol-spacing") { property = Property::SymbolSpacing; } break; case util::hashFNV1a("symbol-avoid-edges"): if (name == "symbol-avoid-edges") { property = Property::SymbolAvoidEdges; } break; case util::hashFNV1a("icon-allow-overlap"): if (name == "icon-allow-overlap") { property = Property::IconAllowOverlap; } break; case util::hashFNV1a("icon-ignore-placement"): if (name == "icon-ignore-placement") { property = Property::IconIgnorePlacement; } break; case util::hashFNV1a("icon-optional"): if (name == "icon-optional") { property = Property::IconOptional; } break; case util::hashFNV1a("icon-rotation-alignment"): if (name == "icon-rotation-alignment") { property = Property::IconRotationAlignment; } break; case util::hashFNV1a("icon-size"): if (name == "icon-size") { property = Property::IconSize; } break; case util::hashFNV1a("icon-text-fit"): if (name == "icon-text-fit") { property = Property::IconTextFit; } break; case util::hashFNV1a("icon-text-fit-padding"): if (name == "icon-text-fit-padding") { property = Property::IconTextFitPadding; } break; case util::hashFNV1a("icon-image"): if (name == "icon-image") { property = Property::IconImage; } break; case util::hashFNV1a("icon-rotate"): if (name == "icon-rotate") { property = Property::IconRotate; } break; case util::hashFNV1a("icon-padding"): if (name == "icon-padding") { property = Property::IconPadding; } break; case util::hashFNV1a("icon-keep-upright"): if (name == "icon-keep-upright") { property = Property::IconKeepUpright; } break; case util::hashFNV1a("icon-offset"): if (name == "icon-offset") { property = Property::IconOffset; } break; case util::hashFNV1a("icon-anchor"): if (name == "icon-anchor") { property = Property::IconAnchor; } break; case util::hashFNV1a("icon-pitch-alignment"): if (name == "icon-pitch-alignment") { property = Property::IconPitchAlignment; } break; case util::hashFNV1a("text-pitch-alignment"): if (name == "text-pitch-alignment") { property = Property::TextPitchAlignment; } break; case util::hashFNV1a("text-rotation-alignment"): if (name == "text-rotation-alignment") { property = Property::TextRotationAlignment; } break; case util::hashFNV1a("text-field"): if (name == "text-field") { property = Property::TextField; } break; case util::hashFNV1a("text-font"): if (name == "text-font") { property = Property::TextFont; } break; case util::hashFNV1a("text-size"): if (name == "text-size") { property = Property::TextSize; } break; case util::hashFNV1a("text-max-width"): if (name == "text-max-width") { property = Property::TextMaxWidth; } break; case util::hashFNV1a("text-line-height"): if (name == "text-line-height") { property = Property::TextLineHeight; } break; case util::hashFNV1a("text-letter-spacing"): if (name == "text-letter-spacing") { property = Property::TextLetterSpacing; } break; case util::hashFNV1a("text-justify"): if (name == "text-justify") { property = Property::TextJustify; } break; case util::hashFNV1a("text-anchor"): if (name == "text-anchor") { property = Property::TextAnchor; } break; case util::hashFNV1a("text-max-angle"): if (name == "text-max-angle") { property = Property::TextMaxAngle; } break; case util::hashFNV1a("text-rotate"): if (name == "text-rotate") { property = Property::TextRotate; } break; case util::hashFNV1a("text-padding"): if (name == "text-padding") { property = Property::TextPadding; } break; case util::hashFNV1a("text-keep-upright"): if (name == "text-keep-upright") { property = Property::TextKeepUpright; } break; case util::hashFNV1a("text-transform"): if (name == "text-transform") { property = Property::TextTransform; } break; case util::hashFNV1a("text-offset"): if (name == "text-offset") { property = Property::TextOffset; } break; case util::hashFNV1a("text-allow-overlap"): if (name == "text-allow-overlap") { property = Property::TextAllowOverlap; } break; case util::hashFNV1a("text-ignore-placement"): if (name == "text-ignore-placement") { property = Property::TextIgnorePlacement; } break; case util::hashFNV1a("text-optional"): if (name == "text-optional") { property = Property::TextOptional; } break; } if (property == Property::Unknown) { return Error { "layer doesn't support this property" }; } if (property == Property::SymbolPlacement) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setSymbolPlacement(*typedValue); return nullopt; } if (property == Property::SymbolSpacing || property == Property::IconPadding || 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::SymbolSpacing) { setSymbolSpacing(*typedValue); return nullopt; } if (property == Property::IconPadding) { setIconPadding(*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::SymbolAvoidEdges || property == Property::IconAllowOverlap || property == Property::IconIgnorePlacement || property == Property::IconOptional || property == Property::IconKeepUpright || property == Property::TextKeepUpright || property == Property::TextAllowOverlap || property == Property::TextIgnorePlacement || property == Property::TextOptional) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::SymbolAvoidEdges) { setSymbolAvoidEdges(*typedValue); return nullopt; } if (property == Property::IconAllowOverlap) { setIconAllowOverlap(*typedValue); return nullopt; } if (property == Property::IconIgnorePlacement) { setIconIgnorePlacement(*typedValue); return nullopt; } if (property == Property::IconOptional) { setIconOptional(*typedValue); return nullopt; } if (property == Property::IconKeepUpright) { setIconKeepUpright(*typedValue); return nullopt; } if (property == Property::TextKeepUpright) { setTextKeepUpright(*typedValue); return nullopt; } if (property == Property::TextAllowOverlap) { setTextAllowOverlap(*typedValue); return nullopt; } if (property == Property::TextIgnorePlacement) { setTextIgnorePlacement(*typedValue); return nullopt; } if (property == Property::TextOptional) { setTextOptional(*typedValue); return nullopt; } } if (property == Property::IconRotationAlignment || property == Property::IconPitchAlignment || property == Property::TextPitchAlignment || property == Property::TextRotationAlignment) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } if (property == Property::IconRotationAlignment) { setIconRotationAlignment(*typedValue); return nullopt; } if (property == Property::IconPitchAlignment) { setIconPitchAlignment(*typedValue); return nullopt; } if (property == Property::TextPitchAlignment) { setTextPitchAlignment(*typedValue); return nullopt; } if (property == Property::TextRotationAlignment) { setTextRotationAlignment(*typedValue); return nullopt; } } if (property == Property::IconSize || property == Property::IconRotate || property == Property::TextSize || property == Property::TextMaxWidth || property == Property::TextLetterSpacing || property == Property::TextRotate) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::IconSize) { setIconSize(*typedValue); return nullopt; } if (property == Property::IconRotate) { setIconRotate(*typedValue); return nullopt; } if (property == Property::TextSize) { setTextSize(*typedValue); return nullopt; } if (property == Property::TextMaxWidth) { setTextMaxWidth(*typedValue); return nullopt; } if (property == Property::TextLetterSpacing) { setTextLetterSpacing(*typedValue); return nullopt; } if (property == Property::TextRotate) { setTextRotate(*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::IconImage || property == Property::TextField) { Error error; optional> typedValue = convert>(value, error, true, true); if (!typedValue) { return error; } if (property == Property::IconImage) { setIconImage(*typedValue); return nullopt; } if (property == Property::TextField) { setTextField(*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::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::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; } return Error { "layer doesn't support this property" }; } } // namespace style } // namespace mbgl