VisualizationLayer
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
Initializes a new instance of the VisualizationLayer class.
public VisualizationLayer()
Fields
AllowDataTemplateForZoomLevelProperty
DependencyProperty
Identifies the AllowDataTemplateForZoomLevel dependency property.
public static readonly DependencyProperty AllowDataTemplateForZoomLevelProperty
AutoCalculateClusteringThresholdProperty
DependencyProperty
Identifies the AutoClusteringThreshold dependency property.
public static readonly DependencyProperty AutoCalculateClusteringThresholdProperty
AutoHighlightMapShapeProperty
DependencyProperty
Identifies the AutoHighlightMapShape dependency property.
public static readonly DependencyProperty AutoHighlightMapShapeProperty
ClusterGeneratorProperty
DependencyProperty
Identifies the ClusterGenerator dependency property.
public static readonly DependencyProperty ClusterGeneratorProperty
ClusteringEnabledProperty
DependencyProperty
Identifies the ClusteringEnabled dependency property.
public static readonly DependencyProperty ClusteringEnabledProperty
ClusteringEnabledThresholdMinItemsProperty
DependencyProperty
Identifies the ClusteringEnabledThresholdMinItems dependency property.
public static readonly DependencyProperty ClusteringEnabledThresholdMinItemsProperty
ClusteringEnabledThresholdProperty
DependencyProperty
Identifies the ClusteringEnabledThreshold dependency property.
public static readonly DependencyProperty ClusteringEnabledThresholdProperty
ClusterItemTemplateProperty
DependencyProperty
Identifies the ClusterItemTemplate dependency property.
public static readonly DependencyProperty ClusterItemTemplateProperty
ClusterTemplateSelectorProperty
DependencyProperty
Identifies the ClusterTemplateSelector dependency property.
public static readonly DependencyProperty ClusterTemplateSelectorProperty
ColorizerProperty
DependencyProperty
Identifies the Colorizer dependency property.
public static readonly DependencyProperty ColorizerProperty
DefaultClusterTemplateProperty
DependencyProperty
Identifies the DefaultClusterTemplate dependency property.
public static readonly DependencyProperty DefaultClusterTemplateProperty
DefaultItemTemplateProperty
DependencyProperty
Identifies the DefaultItemTemplate dependency property.
public static readonly DependencyProperty DefaultItemTemplateProperty
DefaultKmlItemTemplateProperty
DependencyProperty
Identifies the DefaultKmlItemTemplate dependency property.
public static readonly DependencyProperty DefaultKmlItemTemplateProperty
GenerateClustersOnZoomProperty
DependencyProperty
Identifies the GenerateClustersOnZoom dependency property.
public static readonly DependencyProperty GenerateClustersOnZoomProperty
HighlightFillProperty
DependencyProperty
Identifies the HighlightFill dependency property.
public static readonly DependencyProperty HighlightFillProperty
ItemSelectionModeProperty
DependencyProperty
Identifies the ItemSelectionMode dependency property.
public static readonly DependencyProperty ItemSelectionModeProperty
ItemsSourceProperty
DependencyProperty
Identifies the ItemsSource dependency property.
public static readonly DependencyProperty ItemsSourceProperty
ItemTemplateProperty
DependencyProperty
Identifies the ItemTemplate dependency property.
public static readonly DependencyProperty ItemTemplateProperty
ItemTemplateSelectorProperty
DependencyProperty
Identifies the ItemTemplateSelector dependency property.
public static readonly DependencyProperty ItemTemplateSelectorProperty
PropertyAccessorProperty
DependencyProperty
Identifies the PropertyAccessor dependency property.
public static readonly DependencyProperty PropertyAccessorProperty
ReaderProperty
DependencyProperty
Identifies the Reader dependency property.
public static readonly DependencyProperty ReaderProperty
RenderWhileMotionProperty
DependencyProperty
Identifies the RenderWhileMotion dependency property.
public static readonly DependencyProperty RenderWhileMotionProperty
SelectedFillProperty
DependencyProperty
Identifies the SelectedFill dependency property.
public static readonly DependencyProperty SelectedFillProperty
SelectedItemsProperty
DependencyProperty
Identifies the SelectedItems dependency property.
public static readonly DependencyProperty SelectedItemsProperty
SelectionChangedEvent
RoutedEvent
Identifies the SelectionChanged routed event.
public static readonly RoutedEvent SelectionChangedEvent
ShapeFillProperty
DependencyProperty
Identifies the ShapeFillProperty dependency property.
public static readonly DependencyProperty ShapeFillProperty
ShapeTemplateProperty
DependencyProperty
Identifies the ShapeTemplate dependency property.
public static readonly DependencyProperty ShapeTemplateProperty
UseIntersectForShapeSelectionProperty
DependencyProperty
Identifies the UseIntersectForShapeSelection dependency property.
public static readonly DependencyProperty UseIntersectForShapeSelectionProperty
VirtualizationSourceProperty
DependencyProperty
Identifies the VirtualizationSource dependency property.
public static readonly DependencyProperty VirtualizationSourceProperty
ZoomLevelGridListProperty
DependencyProperty
Identifies the ZoomLevelGridList dependency property.
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.
public bool AllowDataTemplateForZoomLevel { get; set; }
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.
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.
public bool AutoHighlightMapShape { get; set; }
Gets or sets cluster generator.
public IClusterGenerator ClusterGenerator { get; set; }
Gets or sets value which indicates whether clustering is enabled.
public bool ClusteringEnabled { get; set; }
Gets or sets clustering enabled threshold.
public int ClusteringEnabledThreshold { get; set; }
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.
public int ClusteringEnabledThresholdMinItems { get; set; }
The clustering threshold will be set if number of the items in every cluster is less than this value.
ClusterItemTemplate
DataTemplate
Gets or sets data template which represents cluster item.
public DataTemplate ClusterItemTemplate { get; set; }
Gets all ClusterData objects currently handled by the VisualizationLayer.
public IEnumerable<ClusterData> Clusters { get; }
ClusterTemplateSelector
DataTemplateSelector
Gets or sets the custom logic for choosing a template used to display each cluster.
public DataTemplateSelector ClusterTemplateSelector { get; set; }
Gets or sets IMapShapeColorizer value to colorize shape or kml file.
public IMapShapeColorizer Colorizer { get; set; }
DefaultClusterTemplate
DataTemplate
Gets or sets the default cluster data template.
public DataTemplate DefaultClusterTemplate { get; set; }
DefaultItemTemplate
DataTemplate
Gets or sets the default data template.
public DataTemplate DefaultItemTemplate { get; set; }
DefaultKmlItemTemplate
DataTemplate
Gets or sets the default data template for KML points.
public DataTemplate DefaultKmlItemTemplate { get; set; }
Gets or sets value which indicates whether clusters should be re-generated when zoom level is changed.
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.
public MapShapeFill HighlightFill { get; set; }
Gets items collection.
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.
public ItemSelectionMode ItemSelectionMode { get; set; }
Gets or sets a collection used to generate the content of the visualization layer.
public IEnumerable ItemsSource { get; set; }
ItemTemplate
DataTemplate
Gets or sets the DataTemplate used to display each item.
public DataTemplate ItemTemplate { get; set; }
ItemTemplateSelector
DataTemplateSelector
Gets or sets the custom logic for choosing a template used to display each item.
public DataTemplateSelector ItemTemplateSelector { get; set; }
Gets or sets map control this layer belongs to.
public RadMap MapControl { get; set; }
Implements:
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.
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.
public AsyncReaderBase Reader { get; set; }
Gets or sets value which indicates whether the layer should request and render items dynamically during panning and zooming.
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.
public MapShapeFill SelectedFill { get; set; }
Gets or sets list of the selected items.
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.
public MapShapeFill ShapeFill { get; set; }
ShapeTemplate
DataTemplate
Gets or sets the map shape visualization data template.
public DataTemplate ShapeTemplate { get; set; }
Gets or sets value which indicates whether bitmap cache should be used to accelerate panning operation.
public bool UseBitmapCache { get; set; }
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).
public bool UseDefaultPropertyAccessor { get; set; }
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).
public bool UseIntersectForShapeSelection { get; set; }
Gets or sets virtualization source.
public IMapItemsVirtualizationSource VirtualizationSource { get; set; }
Gets ZoomLevelGrid collection.
public ZoomLevelGridCollection ZoomLevelGridList { get; }
Methods
Arrange screen position of the item.
public void ArrangeItem(object item)
Item to arrange position. Can be framework element, map shape or data item.
Called to arrange and size the content.
protected override Size ArrangeOverride(Size finalSize)
The computed size that is used to arrange the content.
Returns:Size
The calculated size.
Dispose all resources are used by information layer.
public void Dispose()
Called when visual containers are being disposed.
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.
public static LocationRect GetBestView(IEnumerable<object> itemsList, IMapPropertyAccessor propertyAccessor, Size defaultSize)
List of the items to get best view for.
propertyAccessorIMapPropertyAccessorGets map layer related properties from data items.
defaultSizeSizeDefault size of the region. It is applied when list contains 1 item only.
Returns: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.
public LocationRect GetBestView(IEnumerable<object> itemsList, Size defaultSize)
List of the items to get best view for. The items must be from this list.
defaultSizeSizeDefault size of the region. It is applied when list contains 1 item only.
Returns: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.
public LocationRect GetBestView(IEnumerable<object> itemsList)
List of the items to get best view for. The items must be from this list.
Returns:Location rectangle which represents best view.
Gets cluster which contains given items.
public ClusterData GetClusterForItem(object item)
Item to get cluster for.
Returns:Cluster which contains data item or null.
Returns the container for the specified item.
public UIElement GetContainerFromItem(object item)
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.
public double GetDoubleFromItem(object item, DataMember dataMember)
Item to get value from.
dataMemberDataMemberData member.
Returns:Double value or NaN.
Search the items in the information layer by given location.
public IEnumerable<object> GetItemsInLocation(Location location)
Location to search items at.
Returns: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.
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle, bool useIntersectForShapes)
Rectangle to search elements in.
useIntersectForShapesboolIndicates whether map shapes should be detected using intersection (true) or containment (false).
Returns: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.
public IEnumerable<object> GetItemsInRectangle(LocationRect rectangle)
Rectangle to search elements in.
Returns:Collection of the objects inside rectangle.
Gets geographical location of the data item.
public Location GetLocationFromInfo(MapObjectInfo info)
Item to get location from.
Returns:Location of the data item.
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate.
public override void OnApplyTemplate()
Called when the clusters are invalidated changes.
Called when the layer is being disposed.
protected virtual void OnDispose()
Called when the selection changes.
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
The event data.
Clears items from the layer and re-requests items for regions in current location and zoom.
public void RefreshVirtualSource()
Reset clustering enabled threshold.
public void ResetClusteringThreshold()
Reset all items on the layer.
Reverse selection for the given items. Selected items will be unselected, not selected items will be selected.
public void ReverseSelection(IEnumerable<object> itemsToProcess)
Items to reverse selection for.
Reverse selection for the items in the given location.
public void ReverseSelection(Location location)
Location to search items.
Select given items.
public void Select(IEnumerable<object> itemsToSelect, bool clearSelection)
Items to select.
clearSelectionboolIndicates whether previously selected items should be unselected.
Select items in the given rectangle.
public void Select(LocationRect selectionRect, bool clearSelection)
Rectangle to select items in.
clearSelectionboolIndicates whether previously selected items should be unselected.
Set up clipping for layer.
protected void SetClip(Size size)
Starts the background thread responsible for processing the items from the VirtualizationSource.
protected virtual void StartBackgroundThread()
Stops the background thread responsible for processing the items from the VirtualizationSource.
protected virtual void StopBackgroundThread()
Unselect given items.
public void Unselect(IEnumerable<object> itemsToUnselect)
Items to unselect.
Unselect items in the given location.
Unselect items in the given rectangle.
public void Unselect(LocationRect selectionRect)
Rectangle to unselect items in.
Unselect given item.
Events
Occurs when clusters are invalidated.
public event EventHandler ClustersInvalidated
Occurs when map shape visualization object is created. Can be used to attach event handlers.
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationCreated
Occurs when map shape visualization object is removed. Can be used to detach event handlers.
public event EventHandler<MapShapeOperationEventArgs> MapShapeVisualizationRemoved
SelectionChanged
SelectionChangedEventHandler
Occurs when the selection of a VisualizationLayer changes.
public event SelectionChangedEventHandler SelectionChanged