Skip to content

Commit

Permalink
Update class constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPurdum committed Oct 6, 2023
1 parent 2d798a9 commit f43b845
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
29 changes: 29 additions & 0 deletions src/dymaptic.GeoBlazor.Core/Components/Layers/Label.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,35 @@ namespace dymaptic.GeoBlazor.Core.Components.Layers;
/// </summary>
public class Label : LayerObject
{
/// <summary>
/// Parameterless constructor for use as a Blazor component.
/// </summary>
public Label()
{
}

/// <summary>
/// Constructor for generating in code.
/// </summary>
/// <param name="labelPlacement">
/// The position of the label.
/// </param>
/// <param name="labelExpression">
/// Defines the labels for a MapImageLayer.
/// </param>
/// <param name="labelExpressionInfo">
/// Defines the labels for a <see cref="FeatureLayer" />.
/// </param>
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
}

/// <summary>
/// The position of the label.
/// </summary>
Expand Down
53 changes: 52 additions & 1 deletion src/dymaptic.GeoBlazor.Core/Components/Symbols/TextSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,47 @@ public TextSymbol()
/// <param name="font">
/// The <see cref="MapFont" /> used to style the text.
/// </param>
/// <param name="angle">
/// The angle of the text. 0 is horizontal and the angle moves clockwise.
/// </param>
/// <param name="backgroundColor">
/// The background color of the label's bounding box.
/// </param>
/// <param name="borderLineColor">
/// The border color of the label's bounding box.
/// </param>
/// <param name="borderLineSize">
/// The border size or width of the label's bounding box.
/// </param>
/// <param name="horizontalAlignment">
/// Adjusts the horizontal alignment of the text in multi-lines. Default value is Center.
/// </param>
/// <param name="kerning">
/// Determines whether to adjust the spacing between characters in the text string. Default value is true.
/// </param>
/// <param name="lineHeight">
/// The height of the space between each line of text. Only applies to multiline text.
/// </param>
/// <param name="lineWidth">
/// The maximum length in points for each line of text. This value is a string expressing size in points or pixels (e.g.
/// </param>
/// <param name="rotated">
/// Determines whether every character in the text string is rotated. Default value is false.
/// </param>
/// <param name="verticalAlignment">
/// Adjusts the vertical alignment of the text. Default value is Baseline.
/// </param>
/// <param name="xOffset">
/// The offset on the x-axis in points. This value is a string expressing size in points or pixels (e.g. "12px", "12pt"),
/// </param>
/// <param name="yOffset">
/// The offset on the y-axis in points. This value is a string expressing size in points or pixels (e.g. "12px", "12pt"),
/// </param>
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
Expand All @@ -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
}

Expand Down

0 comments on commit f43b845

Please sign in to comment.