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

Maintains the map's ordered layers and forwards viewport changes and hit tests to them.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

C#
public class MapLayerCollection : IEnumerable

Inheritance: objectMapLayerCollection

Implements: IEnumerable

Constructors

Initializes a new instance of the MapLayerCollection class.

C#
public MapLayerCollection(IMapViewport viewport)
Parameters:viewportIMapViewport

The viewport.

Properties

Gets the number of layers in the collection.

C#
public int Count { get; }

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

C#
public bool IsReadOnly { get; }

Gets the MapLayer at the specified index.

C#
public MapLayer this[int index] { get; }
Parameters:indexint

The index.

Property Value:

Layer.

Gets the MapLayer with the specified name.

C#
public MapLayer this[string name] { get; }
Parameters:namestring

The name.

Property Value:

Layer.

Gets the viewport shared with layers added to this collection.

C#
public IMapViewport Viewport { get; }

Methods

Adds a layer, associates it with this collection's viewport, and invalidates the map.

C#
public void Add(MapLayer item)
Parameters:itemMapLayer

The layer to add.

Exceptions: InvalidOperationException

A layer with the same name is already in the collection.

Suspends updates in all layers.

C#
public void BeginUpdate()

Removes all layers and clears their viewport references.

C#
public void Clear()

Determines whether the collection contains the specified layer.

C#
public bool Contains(MapLayer item)
Parameters:itemMapLayer

The layer to locate.

Returns:

bool

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

Copies the layers into an array, starting at the specified index.

C#
public void CopyTo(MapLayer[] array, int arrayIndex)
Parameters:arrayMapLayer[]

The destination array.

arrayIndexint

The zero-based destination index.

Resumes updates in all layers.

C#
public void EndUpdate()

Returns an enumerator over the layers in their collection order.

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

IEnumerator<MapLayer>

An enumerator for the layers.

Hit tests the overlays in all visible layers.

C#
public MapVisualElement HitTest(Point location)
Parameters:locationPoint

A point in control coordinates.

Returns:

MapVisualElement

Hit tests the overlays in all layers.

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

A point in geo coordinates.

Returns:

MapVisualElement

MapVisualElement.

Hit tests the overlays in all layers.

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

A point in map coordinates.

Returns:

MapVisualElement

MapVisualElement.

Invalidates the associated map element when the viewport is a map element.

C#
public void Invalidate()

Removes a layer and, if successful, clears its viewport reference and invalidates the map.

C#
public bool Remove(MapLayer item)
Parameters:itemMapLayer

The layer to remove.

Returns:

bool

true if the layer was removed; otherwise, false.

Removes the layer whose name matches the specified string.

C#
public bool Remove(string name)
Parameters:namestring

The layer name to find.

Returns:

bool

true if a matching layer was removed; otherwise, false.

Notifies every layer that the map viewport has changed.

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

The updated viewport.

actionViewportChangeAction

The kinds of viewport changes to process.