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:
public abstract class MapPathBasedVisualElement : MapVisualElement, IClusterable, IBorderElement, IBoxStyle, IBoxElement, IFillElement, ITextElement, IShapedElement
Inheritance: objectMapVisualElementMapPathBasedVisualElement
Derived Classes:
Implements:
Inherited Members
Constructors
protected MapPathBasedVisualElement()
Properties
Gets a value indicating whether this instance is visible in the viewport.
public override bool IsInViewport { get; }
true if this instance is visible in the viewport.; otherwise, false.
Overrides:
Gets whether hit testing is limited to the path outline; returning false also makes the filled area hittable.
protected virtual bool IsOutline { get; }
Gets or sets the geographic anchor inherited from MapVisualElement. Setting it clears cached paths for every zoom level.
public override PointG Location { get; set; }
Overrides:
Methods
Creates the path geometry and offset to cache for a viewport zoom level.
protected abstract MapVisualElementInfo CreateVisualElementInfo(IMapViewport viewport)
The viewport used to convert the element's geometry to map coordinates.
Returns: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.
protected MapVisualElementInfo GetVisualElementInfo(IMapViewport viewport)
The viewport whose zoom level selects the cached path.
Returns: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.
public override bool HitTest(PointG pointG, PointL pointL, IMapViewport viewport)
The geographic coordinate corresponding to pointL.
The map-pixel point tested against the path.
viewportIMapViewportThe viewport used to obtain the zoom-specific path and wraparound count.
Returns:Overrides:
Discards cached paths for all zoom levels so they are recreated from the element's current geometry.
protected void ResetGraphicsPathCache()
Ensures path data is cached for a new zoom level and recalculates viewport visibility when the map pans.
public override void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
The map viewport whose zoom or pan changed.
actionViewportChangeActionThe viewport change flags that determine which cached state to update.
Overrides: