Class LabelStyle
Defines a style used for rendering labels
Implements
Inherited Members
Namespace: Mapsui.Styles
Assembly: Mapsui.dll
Syntax
public class LabelStyle : Style, IStyle
Constructors
| Improve this Doc View SourceLabelStyle()
Declaration
public LabelStyle()
LabelStyle(LabelStyle)
Declaration
public LabelStyle(LabelStyle labelStyle)
Parameters
Type | Name | Description |
---|---|---|
LabelStyle | labelStyle |
Properties
| Improve this Doc View SourceBackColor
The background color of the label. Set to transparent brush or null if background isn't needed
Declaration
public Brush BackColor { get; set; }
Property Value
Type | Description |
---|---|
Brush |
CollisionDetection
Gets or sets whether Collision Detection is enabled for the labels. If set to true, label collision will be tested.
Declaration
public bool CollisionDetection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Font
Label Font
Declaration
public Font Font { get; set; }
Property Value
Type | Description |
---|---|
Font |
ForeColor
Font color
Declaration
public Color ForeColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Halo
Creates a halo around the text
Declaration
public Pen Halo { get; set; }
Property Value
Type | Description |
---|---|
Pen |
HorizontalAlignment
The horisontal alignment of the text in relation to the labelpoint
Declaration
public LabelStyle.HorizontalAlignmentEnum HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
LabelStyle.HorizontalAlignmentEnum |
LabelColumn
The column of the feature used by GetLabelText to return the label text.
Declaration
public string LabelColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used only when LabelMethod is not set. Overrides use of the Text field.
LabelMethod
Method used by GetLabelText to return the label text.
Declaration
public Func<IFeature, string> LabelMethod { get; set; }
Property Value
Type | Description |
---|---|
System.Func<IFeature, System.String> |
Remarks
Overrides use of Text and LabelColumn fields.
LineHeight
Space from one text line to next text line in em
Declaration
public double LineHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxWidth
Maximum width of text in em. If text is wider than this, text is shorten or word wrapped regarding WordWrap.
Declaration
public double MaxWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Offset
Specifies relative position of labels with respect to objects label point
Declaration
public Offset Offset { get; set; }
Property Value
Type | Description |
---|---|
Offset |
Text
The text used for this specific label.
Declaration
public string Text { set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used only when LabelColumn and LabelMethod are not set.
VerticalAlignment
The horisontal alignment of the text in relation to the labelpoint
Declaration
public LabelStyle.VerticalAlignmentEnum VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
LabelStyle.VerticalAlignmentEnum |
WordWrap
Line break mode for text, if width is bigger than MaxWidth
Declaration
public LabelStyle.LineBreakMode WordWrap { get; set; }
Property Value
Type | Description |
---|---|
LabelStyle.LineBreakMode |
Methods
| Improve this Doc View SourceGetLabelText(IFeature)
The text used for this specific label.
Declaration
public string GetLabelText(IFeature feature)
Parameters
Type | Name | Description |
---|---|---|
IFeature | feature |
Returns
Type | Description |
---|---|
System.String |