From f43b8450ea604f2e48f02756988626b51ee70ee0 Mon Sep 17 00:00:00 2001 From: Tim Purdum Date: Thu, 5 Oct 2023 20:38:05 -0500 Subject: [PATCH] Update class constructors --- .../Components/Layers/Label.cs | 29 ++++++++++ .../Components/Symbols/TextSymbol.cs | 53 ++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/dymaptic.GeoBlazor.Core/Components/Layers/Label.cs b/src/dymaptic.GeoBlazor.Core/Components/Layers/Label.cs index d027c580..48891a2d 100644 --- a/src/dymaptic.GeoBlazor.Core/Components/Layers/Label.cs +++ b/src/dymaptic.GeoBlazor.Core/Components/Layers/Label.cs @@ -14,6 +14,35 @@ namespace dymaptic.GeoBlazor.Core.Components.Layers; /// public class Label : LayerObject { + /// + /// Parameterless constructor for use as a Blazor component. + /// + public Label() + { + } + + /// + /// Constructor for generating in code. + /// + /// + /// The position of the label. + /// + /// + /// Defines the labels for a MapImageLayer. + /// + /// + /// Defines the labels for a . + /// + public Label(string? labelPlacement = null, string? labelExpression = null, + LabelExpressionInfo? labelExpressionInfo = null) + { +#pragma warning disable BL0005 // Component parameter should not be set outside of its component. + LabelPlacement = labelPlacement; + LabelExpression = labelExpression; + LabelExpressionInfo = labelExpressionInfo; +#pragma warning restore BL0005 + } + /// /// The position of the label. /// diff --git a/src/dymaptic.GeoBlazor.Core/Components/Symbols/TextSymbol.cs b/src/dymaptic.GeoBlazor.Core/Components/Symbols/TextSymbol.cs index 23289a55..5554ccca 100644 --- a/src/dymaptic.GeoBlazor.Core/Components/Symbols/TextSymbol.cs +++ b/src/dymaptic.GeoBlazor.Core/Components/Symbols/TextSymbol.cs @@ -43,8 +43,47 @@ public TextSymbol() /// /// The used to style the text. /// + /// + /// The angle of the text. 0 is horizontal and the angle moves clockwise. + /// + /// + /// The background color of the label's bounding box. + /// + /// + /// The border color of the label's bounding box. + /// + /// + /// The border size or width of the label's bounding box. + /// + /// + /// Adjusts the horizontal alignment of the text in multi-lines. Default value is Center. + /// + /// + /// Determines whether to adjust the spacing between characters in the text string. Default value is true. + /// + /// + /// The height of the space between each line of text. Only applies to multiline text. + /// + /// + /// The maximum length in points for each line of text. This value is a string expressing size in points or pixels (e.g. + /// + /// + /// Determines whether every character in the text string is rotated. Default value is false. + /// + /// + /// Adjusts the vertical alignment of the text. Default value is Baseline. + /// + /// + /// The offset on the x-axis in points. This value is a string expressing size in points or pixels (e.g. "12px", "12pt"), + /// + /// + /// The offset on the y-axis in points. This value is a string expressing size in points or pixels (e.g. "12px", "12pt"), + /// public TextSymbol(string text, MapColor? color = null, MapColor? haloColor = null, int? haloSize = null, - MapFont? font = null) + MapFont? font = null, double? angle = null, MapColor? backgroundColor = null, MapColor? borderLineColor = null, + double? borderLineSize = null, HorizontalAlignment? horizontalAlignment = null, bool? kerning = null, + double? lineHeight = null, string? lineWidth = null, bool? rotated = null, + VerticalAlignment? verticalAlignment = null, string? xOffset = null, string? yOffset = null) { AllowRender = false; #pragma warning disable BL0005 @@ -53,6 +92,18 @@ public TextSymbol(string text, MapColor? color = null, MapColor? haloColor = nul HaloColor = haloColor; HaloSize = haloSize; Font = font; + Angle = angle; + BackgroundColor = backgroundColor; + BorderLineColor = borderLineColor; + BorderLineSize = borderLineSize; + HorizontalAlignment = horizontalAlignment; + Kerning = kerning; + LineHeight = lineHeight; + LineWidth = lineWidth; + Rotated = rotated; + VerticalAlignment = verticalAlignment; + XOffset = xOffset; + YOffset = yOffset; #pragma warning restore BL0005 }