New to Telerik UI for WinForms? Start a free 30-day trial

Displays text and an optional image in a rounded label anchored to a geographic location.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

C#
public class MapLabel : MapPathBasedVisualElement, IClusterable, IBorderElement, IBoxStyle, IBoxElement, IFillElement, ITextElement, IShapedElement

Inheritance: objectMapVisualElementMapPathBasedVisualElementMapLabel

Implements: IBorderElementIBoxElementIBoxStyleIClusterableIFillElementIShapedElementITextElement...

Inherited Members MapPathBasedVisualElement.ViewportChanged(IMapViewport, ViewportChangeAction)MapPathBasedVisualElement.HitTest(PointG, PointL, IMapViewport)MapPathBasedVisualElement.GetVisualElementInfo(IMapViewport)MapPathBasedVisualElement.ResetGraphicsPathCache()MapPathBasedVisualElement.IsInViewportMapPathBasedVisualElement.LocationMapVisualElement.GetGeographicBounds()MapVisualElement.GetCurrentShape()MapVisualElement.GeographicBoundsMapVisualElement.LayerMapVisualElement.IsVisibleMapVisualElement.IsSelectedMapVisualElement.TagMapVisualElement.BackColorMapVisualElement.BackColor2MapVisualElement.BackColor3MapVisualElement.BackColor4MapVisualElement.NumberOfColorsMapVisualElement.GradientAngleMapVisualElement.GradientPercentageMapVisualElement.GradientPercentage2MapVisualElement.GradientStyleMapVisualElement.SizeMapVisualElement.SmoothingModeMapVisualElement.BorderColorMapVisualElement.BorderColor2MapVisualElement.BorderColor3MapVisualElement.BorderColor4MapVisualElement.InnerColorMapVisualElement.InnerColor2MapVisualElement.InnerColor3MapVisualElement.InnerColor4MapVisualElement.BoxStyleMapVisualElement.BorderDrawModeMapVisualElement.BorderDashStyleMapVisualElement.BorderDashPatternMapVisualElement.LeftColorMapVisualElement.LeftShadowColorMapVisualElement.TopColorMapVisualElement.TopShadowColorMapVisualElement.RightColorMapVisualElement.RightShadowColorMapVisualElement.BottomColorMapVisualElement.BottomShadowColorMapVisualElement.BorderWidthMapVisualElement.LeftWidthMapVisualElement.TopWidthMapVisualElement.RightWidthMapVisualElement.BottomWidthMapVisualElement.OffsetMapVisualElement.BorderSizeMapVisualElement.HorizontalWidthMapVisualElement.VerticalWidthMapVisualElement.ForeColorMapVisualElement.FontMapVisualElement.TextMapVisualElement.ToolTipTextMapVisualElement.RawResourceMapVisualElement.Shape...

Constructors

Creates a label at the specified map location and initializes its text and padding.

C#
public MapLabel(PointG location, string text)
Parameters:locationPointG

The geographic location anchoring the label.

textstring

The text displayed in the label.

Properties

Gets or sets the image displayed before the label text. Changing the image clears the cached path so its measured size is recalculated.

C#
public Image Image { get; set; }

Gets whether hit testing treats the label's filled area as selectable rather than testing only its outline.

C#
protected override bool IsOutline { get; }

Overrides: MapPathBasedVisualElement.IsOutline

Gets or sets the padding.

C#
public Padding Padding { get; set; }
Property Value:

The padding.

Methods

Builds the rounded label path above its geographic anchor, sized to its text, image, and padding.

C#
protected override MapVisualElementInfo CreateVisualElementInfo(IMapViewport viewport)
Parameters:viewportIMapViewport

The viewport whose zoom level converts the anchor to map coordinates.

Returns:

MapVisualElementInfo

The rounded label path and its map-coordinate offset.

Overrides: MapPathBasedVisualElement.CreateVisualElementInfo(IMapViewport)

Draws the label background, border, optional image, and text at the geographic anchor, including map wraparound copies.

C#
public override void Paint(IGraphics graphics, IMapViewport viewport)
Parameters:graphicsIGraphics

The graphics context used to draw the label.

viewportIMapViewport

The viewport that supplies the pan, zoom, and wraparound state.

Overrides: MapVisualElement.Paint(IGraphics, IMapViewport)