ClassVisualizationLayer
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:
public class VisualizationLayer : Control, ILayer
Inheritance: objectVisualizationLayer
Implements:
Constructors
VisualizationLayer()
Initializes a new instance of the VisualizationLayer class.
Declaration
public VisualizationLayer()
Fields
AllowDataTemplateForZoomLevelProperty
Identifies the AllowDataTemplateForZoomLevel dependency property.
Declaration
public static readonly DependencyProperty AllowDataTemplateForZoomLevelProperty
Field Value
DependencyProperty
AutoCalculateClusteringThresholdProperty
Identifies the AutoClusteringThreshold dependency property.
Declaration
public static readonly DependencyProperty AutoCalculateClusteringThresholdProperty
Field Value
DependencyProperty
AutoHighlightMapShapeProperty
Identifies the AutoHighlightMapShape dependency property.
Declaration
public static readonly DependencyProperty AutoHighlightMapShapeProperty
Field Value
DependencyProperty
ClusterGeneratorProperty
Identifies the ClusterGenerator dependency property.
Declaration
public static readonly DependencyProperty ClusterGeneratorProperty
Field Value
DependencyProperty
ClusterItemTemplateProperty
Identifies the ClusterItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ClusterItemTemplateProperty
Field Value
DependencyProperty
ClusterTemplateSelectorProperty
Identifies the ClusterTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ClusterTemplateSelectorProperty
Field Value
DependencyProperty
ClusteringEnabledProperty
Identifies the ClusteringEnabled dependency property.
Declaration
public static readonly DependencyProperty ClusteringEnabledProperty
Field Value
DependencyProperty
ClusteringEnabledThresholdMinItemsProperty
Identifies the ClusteringEnabledThresholdMinItems dependency property.
Declaration
public static readonly DependencyProperty ClusteringEnabledThresholdMinItemsProperty
Field Value
DependencyProperty
ClusteringEnabledThresholdProperty
Identifies the ClusteringEnabledThreshold dependency property.
Declaration
public static readonly DependencyProperty ClusteringEnabledThresholdProperty
Field Value
DependencyProperty
ColorizerProperty
Identifies the Colorizer dependency property.
Declaration
public static readonly DependencyProperty ColorizerProperty
Field Value
DependencyProperty
DefaultClusterTemplateProperty
Identifies the DefaultClusterTemplate dependency property.
Declaration
public static readonly DependencyProperty DefaultClusterTemplateProperty
Field Value
DependencyProperty
DefaultItemTemplateProperty
Identifies the DefaultItemTemplate dependency property.
Declaration
public static readonly DependencyProperty DefaultItemTemplateProperty
Field Value
DependencyProperty
DefaultKmlItemTemplateProperty
Identifies the DefaultKmlItemTemplate dependency property.
Declaration
public static readonly DependencyProperty DefaultKmlItemTemplateProperty
Field Value
DependencyProperty
GenerateClustersOnZoomProperty
Identifies the GenerateClustersOnZoom dependency property.
Declaration
public static readonly DependencyProperty GenerateClustersOnZoomProperty
Field Value
DependencyProperty
HighlightFillProperty
Identifies the HighlightFill dependency property.
Declaration
public static readonly DependencyProperty HighlightFillProperty
Field Value
DependencyProperty
ItemSelectionModeProperty
Identifies the ItemSelectionMode dependency property.
Declaration
public static readonly DependencyProperty ItemSelectionModeProperty
Field Value
DependencyProperty
ItemTemplateProperty
Identifies the ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
DependencyProperty
ItemTemplateSelectorProperty
Identifies the ItemTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateSelectorProperty
Field Value
DependencyProperty
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
DependencyProperty
PropertyAccessorProperty
Identifies the PropertyAccessor dependency property.
Declaration
public static readonly DependencyProperty PropertyAccessorProperty
Field Value
DependencyProperty
ReaderProperty
Identifies the Reader dependency property.
Declaration
public static readonly DependencyProperty ReaderProperty
Field Value
DependencyProperty
RenderWhileMotionProperty
Identifies the RenderWhileMotion dependency property.
Declaration
public static readonly DependencyProperty RenderWhileMotionProperty
Field Value
DependencyProperty
SelectedFillProperty
Identifies the SelectedFill dependency property.
Declaration
public static readonly DependencyProperty SelectedFillProperty
Field Value
DependencyProperty
SelectedItemsProperty
Identifies the SelectedItems dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
DependencyProperty
SelectionChangedEvent
Identifies the SelectionChanged routed event.
Declaration
public static readonly RoutedEvent SelectionChangedEvent
Field Value
RoutedEvent
ShapeFillProperty
Identifies the ShapeFillProperty dependency property.
Declaration
public static readonly DependencyProperty ShapeFillProperty
Field Value
DependencyProperty
ShapeTemplateProperty
Identifies the ShapeTemplate dependency property.
Declaration
public static readonly DependencyProperty ShapeTemplateProperty
Field Value
DependencyProperty
UseIntersectForShapeSelectionProperty
Identifies the UseIntersectForShapeSelection dependency property.
Declaration
public static readonly DependencyProperty UseIntersectForShapeSelectionProperty
Field Value
DependencyProperty
VirtualizationSourceProperty
Identifies the VirtualizationSource dependency property.
Declaration
public static readonly DependencyProperty VirtualizationSourceProperty
Field Value
DependencyProperty
ZoomLevelGridListProperty
Identifies the ZoomLevelGridList dependency property.
Declaration
public static readonly DependencyProperty ZoomLevelGridListProperty
Field Value
DependencyProperty
Properties
AllowDataTemplateForZoomLevel
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.
Declaration
public bool AllowDataTemplateForZoomLevel { get; set; }
Property Value
Remarks
Pay attention that re-applying of the data templates is resource consuming operation. Use this feature when you really need it only.
AutoCalculateClusteringThreshold
Gets or sets value which indicates whether the clustering threshold should be calculated automatically.
Declaration
public bool AutoCalculateClusteringThreshold { get; set; }
Property Value
AutoHighlightMapShape
Gets or sets value which indicates whether the map shapes should be highlighted automatically when mouse is over the shape.
ClusterGenerator
Gets or sets cluster generator.
Declaration
public IClusterGenerator ClusterGenerator { get; set; }
Property Value
ClusterItemTemplate
Gets or sets data template which represents cluster item.
Declaration
public DataTemplate ClusterItemTemplate { get; set; }
Property Value
DataTemplate
ClusterTemplateSelector
Gets or sets the custom logic for choosing a template used to display each cluster.
Declaration
public DataTemplateSelector ClusterTemplateSelector { get; set; }
Property Value
DataTemplateSelector
ClusteringEnabled
Gets or sets value which indicates whether clustering is enabled.
ClusteringEnabledThreshold
Gets or sets clustering enabled threshold.
Declaration
public int ClusteringEnabledThreshold { get; set; }
Property Value
Remarks
This value sets the max zoom level for clustering. If zoom level is greater than this value then clustering will be disabled.
ClusteringEnabledThresholdMinItems
Gets or sets minimal number of the items in the cluster for auto calculated clustering threshold.
Declaration
public int ClusteringEnabledThresholdMinItems { get; set; }
Property Value
Remarks
The clustering threshold will be set if number of the items in every cluster is less than this value.
Clusters
Gets all ClusterData objects currently handled by the VisualizationLayer.
Declaration
public IEnumerable<ClusterData> Clusters { get; }
Property Value
Colorizer
Gets or sets IMapShapeColorizer value to colorize shape or kml file.
Declaration
public IMapShapeColorizer Colorizer { get; set; }
Property Value
DefaultClusterTemplate
Gets or sets the default cluster data template.
Declaration
public DataTemplate DefaultClusterTemplate { get; set; }
Property Value
DataTemplate
DefaultItemTemplate
Gets or sets the default data template.
Declaration
public DataTemplate DefaultItemTemplate { get; set; }
Property Value
DataTemplate
DefaultKmlItemTemplate
Gets or sets the default data template for KML points.
Declaration
public DataTemplate DefaultKmlItemTemplate { get; set; }
Property Value
DataTemplate
GenerateClustersOnZoom
Gets or sets value which indicates whether clusters should be re-generated when zoom level is changed.
HighlightFill
Gets or sets default highlight shape fill properties. If highlight fill properties aren't set for MapShapeData object then this properties will be used.
Declaration
public MapShapeFill HighlightFill { get; set; }
Property Value
ItemSelectionMode
Gets or sets the item selection mode. It defines how the item in the visualization layer can be selected using RadMap user interface.
Declaration
public ItemSelectionMode ItemSelectionMode { get; set; }
Property Value
ItemTemplate
Gets or sets the DataTemplate used to display each item.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
DataTemplate
ItemTemplateSelector
Gets or sets the custom logic for choosing a template used to display each item.
Declaration
public DataTemplateSelector ItemTemplateSelector { get; set; }
Property Value
DataTemplateSelector
Items
Gets items collection.
Declaration
public MapItemsCollection Items { get; }
Property Value
ItemsSource
Gets or sets a collection used to generate the content of the visualization layer.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
MapControl
Gets or sets map control this layer belongs to.
Declaration
public RadMap MapControl { get; set; }
Property Value
Implements
PropertyAccessor
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.
Declaration
public IMapPropertyAccessor PropertyAccessor { get; set; }
Property Value
Reader
Gets or sets reader to loading map shapes. The map shapes are loaded by this reader will be added to the information layer automatically.
Declaration
public AsyncReaderBase Reader { get; set; }
Property Value
RenderWhileMotion
Gets or sets value which indicates whether the layer should request and render items dynamically during panning and zooming.
SelectedFill
Gets or sets selected shape fill properties. If fill properties aren't set for MapShapeData object then this properties will be used.
Declaration
public MapShapeFill SelectedFill { get; set; }
Property Value
SelectedItems
Gets or sets list of the selected items.
ShapeFill
Gets or sets default shape fill properties. If fill properties aren't set for MapShapeData object then this properties will be used.
Declaration
public MapShapeFill ShapeFill { get; set; }
Property Value
ShapeTemplate
Gets or sets the map shape visualization data template.
Declaration
public DataTemplate ShapeTemplate { get; set; }
Property Value
DataTemplate
UseBitmapCache
Gets or sets value which indicates whether bitmap cache should be used to accelerate panning operation.
Declaration
public bool UseBitmapCache { get; set; }
Property Value
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.
UseDefaultPropertyAccessor
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).
Declaration
public bool UseDefaultPropertyAccessor { get; set; }
Property Value
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.
UseIntersectForShapeSelection
Gets or sets value which indicates whether map shapes should be selected using intersection (true) or containment (false).
Declaration
public bool UseIntersectForShapeSelection { get; set; }
Property Value
VirtualizationSource
Gets or sets virtualization source.
Declaration
public IMapItemsVirtualizationSource VirtualizationSource { get; set; }
Property Value
ZoomLevelGridList
Gets ZoomLevelGrid collection.
Declaration
public ZoomLevelGridCollection ZoomLevelGridList { get; }
Property Value
Methods
ArrangeItem(object)
Arrange screen position of the item.
Declaration
public void ArrangeItem(object item)
Parameters
item
Item to arrange position. Can be framework element, map shape or data item.
ArrangeOverride(Size)
Called to arrange and size the content.
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
Size
The computed size that is used to arrange the content.
Returns
Size
The calculated size.
ClearSelection(bool)
Clear current selection.
Dispose()
Dispose all resources are used by information layer.
Declaration
public void Dispose()
DisposeContainers()
Called when visual containers are being disposed.
Declaration
protected virtual void DisposeContainers()
GetBestView(IEnumerable<object>)
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.
Declaration
public LocationRect GetBestView(IEnumerable<object> itemsList)
Parameters
itemsList
List of the items to get best view for. The items must be from this list.
Returns
Location rectangle which represents best view.
GetBestView(IEnumerable<object>, IMapPropertyAccessor, Size)
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.
Declaration
public static LocationRect GetBestView(IEnumerable<object> itemsList, IMapPropertyAccessor propertyAccessor, Size defaultSize)
Parameters
itemsList
List of the items to get best view for.
propertyAccessor
Gets map layer related properties from data items.
defaultSize
Size
Default size of the region. It is applied when list contains 1 item only.
Returns
Location rectangle which represents best view.
GetBestView(IEnumerable<object>, Size)
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.
Declaration
public LocationRect GetBestView(IEnumerable<object> itemsList, Size defaultSize)
Parameters
itemsList
List of the items to get best view for. The items must be from this list.
defaultSize
Size
Default size of the region. It is applied when list contains 1 item only.
Returns
Location rectangle which represents best view.
GetClusterForItem(object)
Gets cluster which contains given items.
Declaration
public ClusterData GetClusterForItem(object item)
Parameters
item
Item to get cluster for.
Returns
Cluster which contains data item or null.
GetContainerFromItem(object)
Returns the container for the specified item.
Declaration
public UIElement GetContainerFromItem(object item)
Parameters
item
The item whose container to retrieve.
Returns
UIElement
A UIElement representing the container of the specified item.
GetDoubleFromItem(object, DataMember)
Gets double value from the correspondent attachable property.
Declaration
public double GetDoubleFromItem(object item, DataMember dataMember)
Parameters
item
Item to get value from.
dataMember
Data member.
Returns
Double value or NaN.
GetHotSpotFromItem(object)
Gets Hot Spot from the correspondent attachable property.
GetItemsInLocation(Location)
Search the items in the information layer by given location.
Declaration
public IEnumerable<object> GetItemsInLocation(Location location)
Parameters
location
Location to search items at.
Returns
Enumerator of the items found.
GetItemsInRectangle(LocationRect)
Search the objects in the Visualization Layer by given location rectangle. Returns all objects which are located in the rectangle.
Declaration
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle)
Parameters
rectangle
Rectangle to search elements in.
Returns
Collection of the objects inside rectangle.
GetItemsInRectangle(LocationRect, bool)
Search the objects in the Visualization Layer by given location rectangle. Returns all objects which are located in the rectangle.
Declaration
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle, bool useIntersectForShapes)
Parameters
rectangle
Rectangle to search elements in.
useIntersectForShapes
Indicates whether map shapes should be detected using intersection (true) or containment (false).
Returns
Collection of the objects inside rectangle.
GetLocationFromInfo(MapObjectInfo)
Gets geographical location of the data item.
Declaration
public Location GetLocationFromInfo(MapObjectInfo info)
Parameters
info
Item to get location from.
Returns
Location of the data item.
GetLocationFromItem(object)
Gets geographical location of the data item.
GetZIndexFromItem(object)
Gets ZIndex value from the correspondent attachable property.
GetZoomRangeFromItem(object)
Gets ZoomRange value from the correspondent attachable property.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnClustersInvalidated(EventArgs)
Called when the clusters are invalidated changes.
Declaration
protected virtual void OnClustersInvalidated(EventArgs e)
Parameters
e
The event data.
OnDispose()
Called when the layer is being disposed.
Declaration
protected virtual void OnDispose()
OnMapChanged(RadMap, RadMap)
Called when map control is changed.
OnSelectionChanged(SelectionChangedEventArgs)
Called when the selection changes.
Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
e
SelectionChangedEventArgs
The event data.
RefreshVirtualSource()
Clears items from the layer and re-requests items for regions in current location and zoom.
Declaration
public void RefreshVirtualSource()
ResetClusteringThreshold()
Reset clustering enabled threshold.
Declaration
public void ResetClusteringThreshold()
ResetItems(bool)
Reset all items on the layer.
Declaration
public void ResetItems(bool forceRefresh = false)
Parameters
forceRefresh
ReverseSelection(IEnumerable<object>)
Reverse selection for the given items. Selected items will be unselected, not selected items will be selected.
Declaration
public void ReverseSelection(IEnumerable<object> itemsToProcess)
Parameters
itemsToProcess
Items to reverse selection for.
ReverseSelection(Location)
Reverse selection for the items in the given location.
Declaration
public void ReverseSelection(Location location)
Parameters
location
Location to search items.
Select(IEnumerable<object>, bool)
Select given items.
Declaration
public void Select(IEnumerable<object> itemsToSelect, bool clearSelection)
Parameters
itemsToSelect
Items to select.
clearSelection
Indicates whether previously selected items should be unselected.
Select(Location, bool)
Select items in the given location.
Select(LocationRect, bool)
Select items in the given rectangle.
Declaration
public void Select(LocationRect selectionRect, bool clearSelection)
Parameters
selectionRect
Rectangle to select items in.
clearSelection
Indicates whether previously selected items should be unselected.
Select(object, bool)
Select given item.
SetClip(Size)
Set up clipping for layer.
Declaration
protected void SetClip(Size size)
Parameters
size
Size
StartBackgroundThread()
Starts the background thread responsible for processing the items from the VirtualizationSource.
Declaration
protected virtual void StartBackgroundThread()
StopBackgroundThread()
Stops the background thread responsible for processing the items from the VirtualizationSource.
Declaration
protected virtual void StopBackgroundThread()
Unselect(IEnumerable<object>)
Unselect given items.
Declaration
public void Unselect(IEnumerable<object> itemsToUnselect)
Parameters
itemsToUnselect
Items to unselect.
Unselect(Location)
Unselect items in the given location.
Declaration
public void Unselect(Location location)
Parameters
location
Location to unselect items.
Unselect(LocationRect)
Unselect items in the given rectangle.
Declaration
public void Unselect(LocationRect selectionRect)
Parameters
selectionRect
Rectangle to unselect items in.
Unselect(object)
Unselect given item.
Declaration
public void Unselect(object item)
Parameters
item
Item to unselect.
Events
ClustersInvalidated
Occurs when clusters are invalidated.
Declaration
public event EventHandler ClustersInvalidated
Event Value
MapShapeVisualizationCreated
Occurs when map shape visualization object is created. Can be used to attach event handlers.
Declaration
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationCreated
Event Value
MapShapeVisualizationRemoved
Occurs when map shape visualization object is removed. Can be used to detach event handlers.
Declaration
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationRemoved
Event Value
SelectionChanged
Occurs when the selection of a VisualizationLayer changes.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Value
SelectionChangedEventHandler