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

Groups map visual elements into a visibility, clustering, and colorization unit.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

C#
public class MapLayer : IEnumerable

Inheritance: objectMapLayer

Implements: IEnumerable

Constructors

Initializes a new instance of the MapLayer class.

C#
public MapLayer()

Initializes a new instance of the MapLayer class.

C#
public MapLayer(string name)
Parameters:namestring

The name.

Properties

Gets or sets the cluster distance.

C#
public long ClusterDistance { get; set; }
Property Value:

The cluster distance.

Gets or sets the cluster strategy.

C#
public IMapClusterStrategy ClusterStrategy { get; set; }
Property Value:

The cluster strategy.

Gets or sets the colorization strategy.

C#
public IColorizationStrategy ColorizationStrategy { get; set; }
Property Value:

The colorization strategy.

Gets the number of overlays stored in the layer, including overlays currently represented by clusters.

C#
public int Count { get; }

Gets whether the layer's overlay collection is read-only; this collection allows modification.

C#
public bool IsReadOnly { get; }

Gets a value indicating whether updates are suspended.

C#
public bool IsUpdateSuspended { get; }
Property Value:

true if updates are suspended; otherwise, false.

Gets or sets whether the layer's overlays are painted.

C#
public bool IsVisible { get; set; }

Gets or sets the name.

C#
public string Name { get; set; }
Property Value:

The name.

Gets the overlays contained within this layer.

C#
public ReadOnlyCollection<MapVisualElement> Overlays { get; }
Property Value:

The overlays.

Gets the viewport.

C#
public IMapViewport Viewport { get; }
Property Value:

The viewport.

Gets the currently visible overlays in this layer. When cluster strategy is applied the visible overlays may differ from the user added ones.

C#
public ReadOnlyCollection<MapVisualElement> VisibleOverlays { get; }

Methods

Adds an overlay, assigns this layer to it, and updates the viewport unless updates are suspended.

C#
public void Add(MapVisualElement item)
Parameters:itemMapVisualElement

The overlay to add.

Adds the specified overlays to the layer.

C#
public void AddRange(IEnumerable<MapVisualElement> items)
Parameters:itemsIEnumerable<MapVisualElement>

The items.

Adds the specified overlays to the layer.

C#
public void AddRange(params MapVisualElement[] items)
Parameters:itemsMapVisualElement[]

The items.

Suspends updates.

C#
public void BeginUpdate()

Removes all overlays and clears their Layer references.

C#
public void Clear()

This method does not invalidate the viewport or refresh cached clusters. When clustering is active, previously generated clusters can continue to expose removed overlays until they are regenerated.

Determines whether the layer stores the specified overlay.

C#
public bool Contains(MapVisualElement item)
Parameters:itemMapVisualElement

The overlay to locate.

Returns:

bool

true if the overlay is in the layer; otherwise, false.

Copies the layer's overlays into an array, starting at the specified index.

C#
public void CopyTo(MapVisualElement[] array, int arrayIndex)
Parameters:arrayMapVisualElement[]

The destination array.

arrayIndexint

The zero-based destination index.

Resumes updates and performs an update.

C#
public void EndUpdate()

Resumes updates and performs an update based on the provided parameter

C#
public void EndUpdate(bool update)
Parameters:updatebool

if set to true an update is performed.

Returns an enumerator over the overlays in their collection order.

C#
public IEnumerator<MapVisualElement> GetEnumerator()
Returns:

IEnumerator<MapVisualElement>

An enumerator for the layer's overlays.

Hit tests the overlays in the layer.

C#
protected virtual MapVisualElement HitTest(PointG pointG, PointL pointL)
Parameters:pointGPointG

The point g.

pointLPointL

The point l.

Returns:

MapVisualElement

MapVisualElement.

Hit tests the overlays in the layer.

C#
public MapVisualElement HitTest(PointG point)
Parameters:pointPointG

The point.

Returns:

MapVisualElement

MapVisualElement.

Hit tests the overlays in the layer.

C#
public MapVisualElement HitTest(PointL point)
Parameters:pointPointL

The point.

Returns:

MapVisualElement

MapVisualElement.

Invalidates the map element attached to this layer's viewport, when that viewport is a map element.

C#
protected virtual void Invalidate()

Called when the location property of an overlay changes.

C#
public virtual void OverlayLocationChanged(MapVisualElement overlay)
Parameters:overlayMapVisualElement

Paints the layer to the specified graphics.

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

The graphics.

viewportIMapViewport

The viewport.

Removes an overlay and, when it belongs to this layer, clears its layer reference; a selected overlay is also removed from the map selection.

C#
public bool Remove(MapVisualElement item)
Parameters:itemMapVisualElement

The overlay to remove.

Returns:

bool

true if the overlay was removed; otherwise, false.

This method does not invalidate the viewport or refresh cached clusters. When clustering is active, previously generated clusters can continue to expose the removed overlay until they are regenerated.

Updates the colorizer color of all overlays.

C#
public virtual void UpdateOverlaysColorizerColor()

Called when the viewport is updated.

C#
public virtual void ViewportUpdated(IMapViewport viewport, ViewportChangeAction action)
Parameters:viewportIMapViewport

The viewport.

actionViewportChangeAction

The action.