Show / Hide Table of Contents

    Class LabelStyle

    Defines a style used for rendering labels

    Inheritance
    System.Object
    Style
    LabelStyle
    Implements
    IStyle
    Inherited Members
    Style.MinVisible
    Style.MaxVisible
    Style.Enabled
    Style.Opacity
    Style.Equals(Object)
    Style.Equals(Style)
    Style.GetHashCode()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Mapsui.Styles
    Assembly: Mapsui.dll
    Syntax
    public class LabelStyle : Style, IStyle

    Constructors

    | Improve this Doc View Source

    LabelStyle()

    Declaration
    public LabelStyle()
    | Improve this Doc View Source

    LabelStyle(LabelStyle)

    Declaration
    public LabelStyle(LabelStyle labelStyle)
    Parameters
    Type Name Description
    LabelStyle labelStyle

    Properties

    | Improve this Doc View Source

    BackColor

    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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    Font

    Label Font

    Declaration
    public Font Font { get; set; }
    Property Value
    Type Description
    Font
    | Improve this Doc View Source

    ForeColor

    Font color

    Declaration
    public Color ForeColor { get; set; }
    Property Value
    Type Description
    Color
    | Improve this Doc View Source

    Halo

    Creates a halo around the text

    Declaration
    public Pen Halo { get; set; }
    Property Value
    Type Description
    Pen
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    LineHeight

    Space from one text line to next text line in em

    Declaration
    public double LineHeight { get; set; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    Offset

    Specifies relative position of labels with respect to objects label point

    Declaration
    public Offset Offset { get; set; }
    Property Value
    Type Description
    Offset
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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 Source

    GetLabelText(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

    Implements

    IStyle
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX