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

Base class for map elements whose shape is represented by a graphics path cached for each zoom level. It also supplies viewport visibility and path-based hit testing.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

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

Inheritance: objectMapVisualElementMapPathBasedVisualElement

Derived Classes: MapAirRouteMapCalloutMapClusterMapGeometryMapLabelMapPinMapRoute...

Implements: IBorderElementIBoxElementIBoxStyleIClusterableIFillElementIShapedElementITextElement...

Inherited Members MapVisualElement.Paint(IGraphics, IMapViewport)MapVisualElement.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

C#
protected MapPathBasedVisualElement()

Properties

Gets a value indicating whether this instance is visible in the viewport.

C#
public override bool IsInViewport { get; }
Property Value:

true if this instance is visible in the viewport.; otherwise, false.

Overrides: MapVisualElement.IsInViewport

Gets whether hit testing is limited to the path outline; returning false also makes the filled area hittable.

C#
protected virtual bool IsOutline { get; }

Gets or sets the geographic anchor inherited from MapVisualElement. Setting it clears cached paths for every zoom level.

C#
public override PointG Location { get; set; }

Overrides: MapVisualElement.Location

Methods

Creates the path geometry and offset to cache for a viewport zoom level.

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

The viewport used to convert the element's geometry to map coordinates.

Returns:

MapVisualElementInfo

The path geometry and offset used for painting and hit testing.

Gets the path and offset cached for the viewport's current zoom level, creating them on first access.

C#
protected MapVisualElementInfo GetVisualElementInfo(IMapViewport viewport)
Parameters:viewportIMapViewport

The viewport whose zoom level selects the cached path.

Returns:

MapVisualElementInfo

The path geometry and map-pixel offset for the current zoom level.

Tests the cached path at the specified map-pixel point after checking the original path bounds. The bounds check rejects points outside those bounds before the wraparound loop, so shifted copies do not extend the hit region.

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

The geographic coordinate corresponding to pointL.

pointLPointL

The map-pixel point tested against the path.

viewportIMapViewport

The viewport used to obtain the zoom-specific path and wraparound count.

Returns:

bool

true if the point hits the path; otherwise, false.

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

Discards cached paths for all zoom levels so they are recreated from the element's current geometry.

C#
protected void ResetGraphicsPathCache()

Ensures path data is cached for a new zoom level and recalculates viewport visibility when the map pans.

C#
public override void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
Parameters:viewportIMapViewport

The map viewport whose zoom or pan changed.

actionViewportChangeAction

The viewport change flags that determine which cached state to update.

Overrides: MapVisualElement.ViewportChanged(IMapViewport, ViewportChangeAction)