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

MapPin

Class

Represents a map pin graphical object that displays a pin-shaped marker at a specific geographic location with customizable appearance and hit testing.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

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

Inheritance: objectMapVisualElementMapPathBasedVisualElementMapPin

Implements: IBorderElementIBoxElementIBoxStyleIClusterableIFillElementIShapedElementITextElement...

Inherited Members MapPathBasedVisualElement.ViewportChanged(IMapViewport, ViewportChangeAction)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.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

Initializes a new instance of the MapPin class at the specified geographic location with default appearance settings.

C#
public MapPin(PointG location)
Parameters:locationPointG

The PointG geographic location where the pin will be positioned on the map.

Properties

Gets a value indicating whether this pin uses outline rendering mode, always returning false for filled pin display.

C#
protected override bool IsOutline { get; }

Overrides: MapPathBasedVisualElement.IsOutline

Gets or sets the size of the pin in pixels, automatically invalidating the graphics path cache when changed for proper redrawing.

C#
public override Size Size { get; set; }

Overrides: MapVisualElement.Size

Methods

Creates the visual element information including the pin-shaped graphics path and pixel offset for rendering at the specified viewport.

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

The IMapViewport used for calculating pixel coordinates and path dimensions.

Returns:

MapVisualElementInfo

A MapVisualElementInfo containing the graphics path and offset information for the pin.

Overrides: MapPathBasedVisualElement.CreateVisualElementInfo(IMapViewport)

Performs hit testing to determine if the specified point intersects with the pin's center dot area, including wraparound positioning support.

C#
public override bool HitTest(PointG pointG, PointL pointL, IMapViewport viewport)
Parameters:pointGPointG

The PointG geographic coordinates to test for intersection.

pointLPointL

The PointL pixel coordinates to test for intersection.

viewportIMapViewport

The IMapViewport providing zoom level and wraparound information for accurate hit testing.

Returns:

bool

True if the point intersects with the pin's center dot area; otherwise, false.

Overrides: MapPathBasedVisualElement.HitTest(PointG, PointL, IMapViewport)

Paints the map pin to the specified graphics context with anti-aliasing, fill, border, and center dot rendering including wraparound support.

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

The IGraphics context used for rendering the pin.

viewportIMapViewport

The IMapViewport providing zoom level, pan offset, and wraparound information.

Overrides: MapVisualElement.Paint(IGraphics, IMapViewport)