New to Telerik UI for WPFStart a free 30-day trial

Represents data visualization layer. Allows showing of the geographically positioned framework elements and map shapes over the map.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
public class VisualizationLayer : Control, ILayer

Inheritance: objectVisualizationLayer

Implements: ILayer

Constructors

Initializes a new instance of the VisualizationLayer class.

C#
public VisualizationLayer()

Fields

Identifies the AllowDataTemplateForZoomLevel dependency property.

C#
public static readonly DependencyProperty AllowDataTemplateForZoomLevelProperty

Identifies the AutoClusteringThreshold dependency property.

C#
public static readonly DependencyProperty AutoCalculateClusteringThresholdProperty

Identifies the AutoHighlightMapShape dependency property.

C#
public static readonly DependencyProperty AutoHighlightMapShapeProperty

ClusterGeneratorProperty

DependencyProperty

Identifies the ClusterGenerator dependency property.

C#
public static readonly DependencyProperty ClusterGeneratorProperty

ClusteringEnabledProperty

DependencyProperty

Identifies the ClusteringEnabled dependency property.

C#
public static readonly DependencyProperty ClusteringEnabledProperty

Identifies the ClusteringEnabledThresholdMinItems dependency property.

C#
public static readonly DependencyProperty ClusteringEnabledThresholdMinItemsProperty

Identifies the ClusteringEnabledThreshold dependency property.

C#
public static readonly DependencyProperty ClusteringEnabledThresholdProperty

ClusterItemTemplateProperty

DependencyProperty

Identifies the ClusterItemTemplate dependency property.

C#
public static readonly DependencyProperty ClusterItemTemplateProperty

Identifies the ClusterTemplateSelector dependency property.

C#
public static readonly DependencyProperty ClusterTemplateSelectorProperty

ColorizerProperty

DependencyProperty

Identifies the Colorizer dependency property.

C#
public static readonly DependencyProperty ColorizerProperty

Identifies the DefaultClusterTemplate dependency property.

C#
public static readonly DependencyProperty DefaultClusterTemplateProperty

DefaultItemTemplateProperty

DependencyProperty

Identifies the DefaultItemTemplate dependency property.

C#
public static readonly DependencyProperty DefaultItemTemplateProperty

Identifies the DefaultKmlItemTemplate dependency property.

C#
public static readonly DependencyProperty DefaultKmlItemTemplateProperty

Identifies the GenerateClustersOnZoom dependency property.

C#
public static readonly DependencyProperty GenerateClustersOnZoomProperty

HighlightFillProperty

DependencyProperty

Identifies the HighlightFill dependency property.

C#
public static readonly DependencyProperty HighlightFillProperty

ItemSelectionModeProperty

DependencyProperty

Identifies the ItemSelectionMode dependency property.

C#
public static readonly DependencyProperty ItemSelectionModeProperty

ItemsSourceProperty

DependencyProperty

Identifies the ItemsSource dependency property.

C#
public static readonly DependencyProperty ItemsSourceProperty

ItemTemplateProperty

DependencyProperty

Identifies the ItemTemplate dependency property.

C#
public static readonly DependencyProperty ItemTemplateProperty

Identifies the ItemTemplateSelector dependency property.

C#
public static readonly DependencyProperty ItemTemplateSelectorProperty

PropertyAccessorProperty

DependencyProperty

Identifies the PropertyAccessor dependency property.

C#
public static readonly DependencyProperty PropertyAccessorProperty

ReaderProperty

DependencyProperty

Identifies the Reader dependency property.

C#
public static readonly DependencyProperty ReaderProperty

RenderWhileMotionProperty

DependencyProperty

Identifies the RenderWhileMotion dependency property.

C#
public static readonly DependencyProperty RenderWhileMotionProperty

SelectedFillProperty

DependencyProperty

Identifies the SelectedFill dependency property.

C#
public static readonly DependencyProperty SelectedFillProperty

SelectedItemsProperty

DependencyProperty

Identifies the SelectedItems dependency property.

C#
public static readonly DependencyProperty SelectedItemsProperty

Identifies the SelectionChanged routed event.

C#
public static readonly RoutedEvent SelectionChangedEvent

ShapeFillProperty

DependencyProperty

Identifies the ShapeFillProperty dependency property.

C#
public static readonly DependencyProperty ShapeFillProperty

ShapeTemplateProperty

DependencyProperty

Identifies the ShapeTemplate dependency property.

C#
public static readonly DependencyProperty ShapeTemplateProperty

Identifies the UseIntersectForShapeSelection dependency property.

C#
public static readonly DependencyProperty UseIntersectForShapeSelectionProperty

Identifies the VirtualizationSource dependency property.

C#
public static readonly DependencyProperty VirtualizationSourceProperty

ZoomLevelGridListProperty

DependencyProperty

Identifies the ZoomLevelGridList dependency property.

C#
public static readonly DependencyProperty ZoomLevelGridListProperty

Properties

Gets or sets value which indicates whether the DataTemplate will be re-applied to the map items when zoom level is changed. It makes possible creation of the DataTemplateSelector which will return data templates depends on the map zoom level.

C#
public bool AllowDataTemplateForZoomLevel { get; set; }
Remarks:

Pay attention that re-applying of the data templates is resource consuming operation. Use this feature when you really need it only.

Gets or sets value which indicates whether the clustering threshold should be calculated automatically.

C#
public bool AutoCalculateClusteringThreshold { get; set; }

Gets or sets value which indicates whether the map shapes should be highlighted automatically when mouse is over the shape.

C#
public bool AutoHighlightMapShape { get; set; }

Gets or sets cluster generator.

C#
public IClusterGenerator ClusterGenerator { get; set; }

Gets or sets value which indicates whether clustering is enabled.

C#
public bool ClusteringEnabled { get; set; }

Gets or sets clustering enabled threshold.

C#
public int ClusteringEnabledThreshold { get; set; }
Remarks:

This value sets the max zoom level for clustering. If zoom level is greater than this value then clustering will be disabled.

Gets or sets minimal number of the items in the cluster for auto calculated clustering threshold.

C#
public int ClusteringEnabledThresholdMinItems { get; set; }
Remarks:

The clustering threshold will be set if number of the items in every cluster is less than this value.

Gets or sets data template which represents cluster item.

C#
public DataTemplate ClusterItemTemplate { get; set; }

Gets all ClusterData objects currently handled by the VisualizationLayer.

C#
public IEnumerable<ClusterData> Clusters { get; }

ClusterTemplateSelector

DataTemplateSelector

Gets or sets the custom logic for choosing a template used to display each cluster.

C#
public DataTemplateSelector ClusterTemplateSelector { get; set; }

Gets or sets IMapShapeColorizer value to colorize shape or kml file.

C#
public IMapShapeColorizer Colorizer { get; set; }

Gets or sets the default cluster data template.

C#
public DataTemplate DefaultClusterTemplate { get; set; }

Gets or sets the default data template.

C#
public DataTemplate DefaultItemTemplate { get; set; }

Gets or sets the default data template for KML points.

C#
public DataTemplate DefaultKmlItemTemplate { get; set; }

Gets or sets value which indicates whether clusters should be re-generated when zoom level is changed.

C#
public bool GenerateClustersOnZoom { get; set; }

Gets or sets default highlight shape fill properties. If highlight fill properties aren't set for MapShapeData object then this properties will be used.

C#
public MapShapeFill HighlightFill { get; set; }

Gets items collection.

C#
public MapItemsCollection Items { get; }

Gets or sets the item selection mode. It defines how the item in the visualization layer can be selected using RadMap user interface.

C#
public ItemSelectionMode ItemSelectionMode { get; set; }

Gets or sets a collection used to generate the content of the visualization layer.

C#
public IEnumerable ItemsSource { get; set; }

ItemTemplate

DataTemplate

Gets or sets the DataTemplate used to display each item.

C#
public DataTemplate ItemTemplate { get; set; }

ItemTemplateSelector

DataTemplateSelector

Gets or sets the custom logic for choosing a template used to display each item.

C#
public DataTemplateSelector ItemTemplateSelector { get; set; }

Gets or sets map control this layer belongs to.

C#
public RadMap MapControl { get; set; }

Implements: ILayer.MapControl

Gets or sets map property accessor. Map property accessor is an object which read map layer related properties (location, hot spot and so on) from data items.

C#
public IMapPropertyAccessor PropertyAccessor { get; set; }

Gets or sets reader to loading map shapes. The map shapes are loaded by this reader will be added to the information layer automatically.

C#
public AsyncReaderBase Reader { get; set; }

Gets or sets value which indicates whether the layer should request and render items dynamically during panning and zooming.

C#
public bool RenderWhileMotion { get; set; }

Gets or sets selected shape fill properties. If fill properties aren't set for MapShapeData object then this properties will be used.

C#
public MapShapeFill SelectedFill { get; set; }

Gets or sets list of the selected items.

C#
public IList<object> SelectedItems { get; set; }

Gets or sets default shape fill properties. If fill properties aren't set for MapShapeData object then this properties will be used.

C#
public MapShapeFill ShapeFill { get; set; }

ShapeTemplate

DataTemplate

Gets or sets the map shape visualization data template.

C#
public DataTemplate ShapeTemplate { get; set; }

Gets or sets value which indicates whether bitmap cache should be used to accelerate panning operation.

C#
public bool UseBitmapCache { get; set; }
Remarks:

Using of the bitmap cache significantly increase memory usage when map shapes exists on the layer. We recommend to turn it off for layers with lot of map shapes.

Gets or sets value which indicates whether the default (reflection-based) property accessor should be used to access item's map-relative properties (like Location or ZoomRange).

C#
public bool UseDefaultPropertyAccessor { get; set; }
Remarks:

If you set this value to true and do not specify property accessor then default one will be created. Accessing item's properties using accessor is faster then obtaining them from the content presenter bindings. But you should keep in mind that default accessor use some assumptions about data item properties. So if properties of the data items differ from ones are used in default accessor then you should create your own custom data accessor.

Gets or sets value which indicates whether map shapes should be selected using intersection (true) or containment (false).

C#
public bool UseIntersectForShapeSelection { get; set; }

Gets or sets virtualization source.

C#
public IMapItemsVirtualizationSource VirtualizationSource { get; set; }

Gets ZoomLevelGrid collection.

C#
public ZoomLevelGridCollection ZoomLevelGridList { get; }

Methods

Arrange screen position of the item.

C#
public void ArrangeItem(object item)
Parameters:itemobject

Item to arrange position. Can be framework element, map shape or data item.

Called to arrange and size the content.

C#
protected override Size ArrangeOverride(Size finalSize)
Parameters:finalSizeSize

The computed size that is used to arrange the content.

Returns:

Size

The calculated size.

Clear current selection.

C#
public List<object> ClearSelection(bool updateSelectedItems)
Parameters:updateSelectedItemsbool

Indicates whether SelectedItems collection should be updated as well.

Returns:

List<object>

List of the unselected items.

Dispose all resources are used by information layer.

C#
public void Dispose()

Called when visual containers are being disposed.

C#
protected virtual void DisposeContainers()

Gets location rectangle which represents best view for the given list of the items. This method doesn't take in account visible size of the objects.

C#
public static LocationRect GetBestView(IEnumerable<object> itemsList, IMapPropertyAccessor propertyAccessor, Size defaultSize)
Parameters:itemsListIEnumerable<object>

List of the items to get best view for.

propertyAccessorIMapPropertyAccessor

Gets map layer related properties from data items.

defaultSizeSize

Default size of the region. It is applied when list contains 1 item only.

Returns:

LocationRect

Location rectangle which represents best view.

Gets location rectangle which represents best view for the given list of the items. This method doesn't take in account visible size of the objects.

C#
public LocationRect GetBestView(IEnumerable<object> itemsList, Size defaultSize)
Parameters:itemsListIEnumerable<object>

List of the items to get best view for. The items must be from this list.

defaultSizeSize

Default size of the region. It is applied when list contains 1 item only.

Returns:

LocationRect

Location rectangle which represents best view.

Gets location rectangle which represents best view for the given list of the items. This method doesn't take in account visible size of the objects.

C#
public LocationRect GetBestView(IEnumerable<object> itemsList)
Parameters:itemsListIEnumerable<object>

List of the items to get best view for. The items must be from this list.

Returns:

LocationRect

Location rectangle which represents best view.

Gets cluster which contains given items.

C#
public ClusterData GetClusterForItem(object item)
Parameters:itemobject

Item to get cluster for.

Returns:

ClusterData

Cluster which contains data item or null.

Returns the container for the specified item.

C#
public UIElement GetContainerFromItem(object item)
Parameters:itemobject

The item whose container to retrieve.

Returns:

UIElement

A UIElement representing the container of the specified item.

Gets double value from the correspondent attachable property.

C#
public double GetDoubleFromItem(object item, DataMember dataMember)
Parameters:itemobject

Item to get value from.

dataMemberDataMember

Data member.

Returns:

double

Double value or NaN.

Gets Hot Spot from the correspondent attachable property.

C#
public HotSpot GetHotSpotFromItem(object item)
Parameters:itemobject

Item to get value from.

Returns:

HotSpot

Hot spot or null.

Search the items in the information layer by given location.

C#
public IEnumerable<object> GetItemsInLocation(Location location)
Parameters:locationLocation

Location to search items at.

Returns:

IEnumerable<object>

Enumerator of the items found.

Search the objects in the Visualization Layer by given location rectangle. Returns all objects which are located in the rectangle.

C#
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle, bool useIntersectForShapes)
Parameters:rectangleLocationRect

Rectangle to search elements in.

useIntersectForShapesbool

Indicates whether map shapes should be detected using intersection (true) or containment (false).

Returns:

IEnumerable<object>

Collection of the objects inside rectangle.

Search the objects in the Visualization Layer by given location rectangle. Returns all objects which are located in the rectangle.

C#
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle)
Parameters:rectangleLocationRect

Rectangle to search elements in.

Returns:

IEnumerable<object>

Collection of the objects inside rectangle.

Gets geographical location of the data item.

C#
public Location GetLocationFromInfo(MapObjectInfo info)
Parameters:infoMapObjectInfo

Item to get location from.

Returns:

Location

Location of the data item.

Gets geographical location of the data item.

C#
public Location GetLocationFromItem(object item)
Parameters:itemobject

Item to get location from.

Returns:

Location

Location of the data item.

Gets ZIndex value from the correspondent attachable property.

C#
public int GetZIndexFromItem(object item)
Parameters:itemobject

Item to get value from.

Returns:

int

ZIndex or 0.

Gets ZoomRange value from the correspondent attachable property.

C#
public ZoomRange GetZoomRangeFromItem(object item)
Parameters:itemobject

Item to get value from.

Returns:

ZoomRange

Zoom range value or ZoomRange.Empty.

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate.

C#
public override void OnApplyTemplate()

Called when the clusters are invalidated changes.

C#
protected virtual void OnClustersInvalidated(EventArgs e)
Parameters:eEventArgs

The event data.

Called when the layer is being disposed.

C#
protected virtual void OnDispose()

Called when map control is changed.

C#
protected void OnMapChanged(RadMap oldMap, RadMap newMap)
Parameters:oldMapRadMap

Old map control.

newMapRadMap

New map control.

Called when the selection changes.

C#
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters:eSelectionChangedEventArgs

The event data.

Clears items from the layer and re-requests items for regions in current location and zoom.

C#
public void RefreshVirtualSource()

Reset clustering enabled threshold.

C#
public void ResetClusteringThreshold()

Reset all items on the layer.

C#
public void ResetItems(bool forceRefresh = false)
Parameters:forceRefreshbool

Reverse selection for the given items. Selected items will be unselected, not selected items will be selected.

C#
public void ReverseSelection(IEnumerable<object> itemsToProcess)
Parameters:itemsToProcessIEnumerable<object>

Items to reverse selection for.

Reverse selection for the items in the given location.

C#
public void ReverseSelection(Location location)
Parameters:locationLocation

Location to search items.

Select given items.

C#
public void Select(IEnumerable<object> itemsToSelect, bool clearSelection)
Parameters:itemsToSelectIEnumerable<object>

Items to select.

clearSelectionbool

Indicates whether previously selected items should be unselected.

Select items in the given location.

C#
public void Select(Location location, bool clearSelection)
Parameters:locationLocation

Location to select items.

clearSelectionbool

Indicates whether previously selected items should be unselected.

Select items in the given rectangle.

C#
public void Select(LocationRect selectionRect, bool clearSelection)
Parameters:selectionRectLocationRect

Rectangle to select items in.

clearSelectionbool

Indicates whether previously selected items should be unselected.

Select given item.

C#
public void Select(object item, bool clearSelection)
Parameters:itemobject

Item to select.

clearSelectionbool

Indicates whether previously selected items should be unselected.

Set up clipping for layer.

C#
protected void SetClip(Size size)
Parameters:sizeSize

Starts the background thread responsible for processing the items from the VirtualizationSource.

C#
protected virtual void StartBackgroundThread()

Stops the background thread responsible for processing the items from the VirtualizationSource.

C#
protected virtual void StopBackgroundThread()

Unselect given items.

C#
public void Unselect(IEnumerable<object> itemsToUnselect)
Parameters:itemsToUnselectIEnumerable<object>

Items to unselect.

Unselect items in the given location.

C#
public void Unselect(Location location)
Parameters:locationLocation

Location to unselect items.

Unselect items in the given rectangle.

C#
public void Unselect(LocationRect selectionRect)
Parameters:selectionRectLocationRect

Rectangle to unselect items in.

Unselect given item.

C#
public void Unselect(object item)
Parameters:itemobject

Item to unselect.

Events

Occurs when clusters are invalidated.

C#
public event EventHandler ClustersInvalidated

Occurs when map shape visualization object is created. Can be used to attach event handlers.

C#
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationCreated

Occurs when map shape visualization object is removed. Can be used to detach event handlers.

C#
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationRemoved

SelectionChanged

SelectionChangedEventHandler

Occurs when the selection of a VisualizationLayer changes.

C#
public event SelectionChangedEventHandler SelectionChanged
In this article
DefinitionConstructorsVisualizationLayer()FieldsAllowDataTemplateForZoomLevelPropertyAutoCalculateClusteringThresholdPropertyAutoHighlightMapShapePropertyClusterGeneratorPropertyClusteringEnabledPropertyClusteringEnabledThresholdMinItemsPropertyClusteringEnabledThresholdPropertyClusterItemTemplatePropertyClusterTemplateSelectorPropertyColorizerPropertyDefaultClusterTemplatePropertyDefaultItemTemplatePropertyDefaultKmlItemTemplatePropertyGenerateClustersOnZoomPropertyHighlightFillPropertyItemSelectionModePropertyItemsSourcePropertyItemTemplatePropertyItemTemplateSelectorPropertyPropertyAccessorPropertyReaderPropertyRenderWhileMotionPropertySelectedFillPropertySelectedItemsPropertySelectionChangedEventShapeFillPropertyShapeTemplatePropertyUseIntersectForShapeSelectionPropertyVirtualizationSourcePropertyZoomLevelGridListPropertyPropertiesAllowDataTemplateForZoomLevelAutoCalculateClusteringThresholdAutoHighlightMapShapeClusterGeneratorClusteringEnabledClusteringEnabledThresholdClusteringEnabledThresholdMinItemsClusterItemTemplateClustersClusterTemplateSelectorColorizerDefaultClusterTemplateDefaultItemTemplateDefaultKmlItemTemplateGenerateClustersOnZoomHighlightFillItemsItemSelectionModeItemsSourceItemTemplateItemTemplateSelectorMapControlPropertyAccessorReaderRenderWhileMotionSelectedFillSelectedItemsShapeFillShapeTemplateUseBitmapCacheUseDefaultPropertyAccessorUseIntersectForShapeSelectionVirtualizationSourceZoomLevelGridListMethodsArrangeItem(object)ArrangeOverride(Size)ClearSelection(bool)Dispose()DisposeContainers()GetBestView(IEnumerable<object>, IMapPropertyAccessor, Size)GetBestView(IEnumerable<object>, Size)GetBestView(IEnumerable<object>)GetClusterForItem(object)GetContainerFromItem(object)GetDoubleFromItem(object, DataMember)GetHotSpotFromItem(object)GetItemsInLocation(Location)GetItemsInRectangle(LocationRect, bool)GetItemsInRectangle(LocationRect)GetLocationFromInfo(MapObjectInfo)GetLocationFromItem(object)GetZIndexFromItem(object)GetZoomRangeFromItem(object)OnApplyTemplate()OnClustersInvalidated(EventArgs)OnDispose()OnMapChanged(RadMap, RadMap)OnSelectionChanged(SelectionChangedEventArgs)RefreshVirtualSource()ResetClusteringThreshold()ResetItems(bool)ReverseSelection(IEnumerable<object>)ReverseSelection(Location)Select(IEnumerable<object>, bool)Select(Location, bool)Select(LocationRect, bool)Select(object, bool)SetClip(Size)StartBackgroundThread()StopBackgroundThread()Unselect(IEnumerable<object>)Unselect(Location)Unselect(LocationRect)Unselect(object)EventsClustersInvalidatedMapShapeVisualizationCreatedMapShapeVisualizationRemovedSelectionChanged
Not finding the help you need?
Contact Support