Class RadMap
Represents the RadMap class.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.DataVisualization.dll
Syntax
[TelerikToolboxCategory("Data Visualization")]
public class RadMap : ItemsControl
Constructors
RadMap()
Initializes a new instance of the RadMap class.
Declaration
public RadMap()
Fields
CenterProperty
Identifies the Center Center dependency property.
Declaration
public static readonly DependencyProperty CenterProperty
Field Value
System.Windows.DependencyProperty
|
CommandBarVisibilityProperty
Identifies the CommandBarVisibility dependency property.
Declaration
public static readonly DependencyProperty CommandBarVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
DistanceUnitProperty
Identifies the DistanceUnit DistanceUnit dependency property.
Declaration
public static readonly DependencyProperty DistanceUnitProperty
Field Value
System.Windows.DependencyProperty
|
GeoBoundsNWProperty
Identifies the GeoBoundsNW GeoBoundsNW dependency property.
Declaration
public static readonly DependencyProperty GeoBoundsNWProperty
Field Value
System.Windows.DependencyProperty
|
GeoBoundsProperty
Identifies the GeoBounds GeoBounds dependency property.
Declaration
public static readonly DependencyProperty GeoBoundsProperty
Field Value
System.Windows.DependencyProperty
|
GeoBoundsSEProperty
Identifies the GeoBoundsSE GeoBoundsSE dependency property.
Declaration
public static readonly DependencyProperty GeoBoundsSEProperty
Field Value
System.Windows.DependencyProperty
|
IsKeyboardNavigationEnabledProperty
IsMiniMapExpandedProperty
Identifies the IsMiniMapExpanded dependency property.
Declaration
public static readonly DependencyProperty IsMiniMapExpandedProperty
Field Value
System.Windows.DependencyProperty
|
MapMouseClickEvent
Identifies the MapMouseClick routed event.
Declaration
public static readonly RoutedEvent MapMouseClickEvent
Field Value
RoutedEvent
|
MapMouseDoubleClickEvent
Identifies the MapMouseDoubleClick routed event.
Declaration
public static readonly RoutedEvent MapMouseDoubleClickEvent
Field Value
RoutedEvent
|
MaxZoomLevelProperty
Identifies the MaxZoomLevel dependency property.
Declaration
public static readonly DependencyProperty MaxZoomLevelProperty
Field Value
System.Windows.DependencyProperty
|
MiniMapExpanderVisibilityProperty
Identifies the MiniMapExpanderVisibility dependency property.
Declaration
public static readonly DependencyProperty MiniMapExpanderVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
MiniMapHeightProperty
Identifies the MiniMapHeight dependency property.
Declaration
public static readonly DependencyProperty MiniMapHeightProperty
Field Value
System.Windows.DependencyProperty
|
MiniMapWidthProperty
Identifies the MiniMapWidth dependency property.
Declaration
public static readonly DependencyProperty MiniMapWidthProperty
Field Value
System.Windows.DependencyProperty
|
MinZoomLevelProperty
Identifies the MinZoomLevel dependency property.
Declaration
public static readonly DependencyProperty MinZoomLevelProperty
Field Value
System.Windows.DependencyProperty
|
MouseClickModeProperty
Identifies the MouseClickMode dependency property.
Declaration
public static readonly DependencyProperty MouseClickModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseDoubleClickModeProperty
Identifies the MouseDoubleClickMode dependency property.
Declaration
public static readonly DependencyProperty MouseDoubleClickModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseDragModeProperty
Identifies the MouseDragMode dependency property.
Declaration
public static readonly DependencyProperty MouseDragModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseLocationIndicatorVisibilityProperty
Identifies the MouseLocationIndicatorVisibility dependency property.
Declaration
public static readonly DependencyProperty MouseLocationIndicatorVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
MouseSelectionModeProperty
Identifies the MouseSelectionMode dependency property.
Declaration
public static readonly DependencyProperty MouseSelectionModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseShiftDragModeProperty
Identifies the MouseShiftDragMode dependency property.
Declaration
public static readonly DependencyProperty MouseShiftDragModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseWheelModeProperty
Identifies the MouseWheelMode dependency property.
Declaration
public static readonly DependencyProperty MouseWheelModeProperty
Field Value
System.Windows.DependencyProperty
|
MouseWheelSensitivityProperty
Identifies the MouseWheelSensitivity dependency property.
Declaration
public static readonly DependencyProperty MouseWheelSensitivityProperty
Field Value
System.Windows.DependencyProperty
|
NavigationVisibilityProperty
PanningFinishedEvent
Identifies the PanningFinished routed event.
Declaration
public static readonly RoutedEvent PanningFinishedEvent
Field Value
RoutedEvent
|
ProviderProperty
Identifies the Provider Provider dependency property.
Declaration
public static readonly DependencyProperty ProviderProperty
Field Value
System.Windows.DependencyProperty
|
ProvidersProperty
Identifies the Providers dependency property.
Declaration
public static readonly DependencyProperty ProvidersProperty
Field Value
System.Windows.DependencyProperty
|
ScaleVisibilityProperty
Identifies the ScaleVisibility dependency property.
Declaration
public static readonly DependencyProperty ScaleVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
UseDefaultLayoutProperty
Identifies the UseDefaultLayout dependency property.
Declaration
public static readonly DependencyProperty UseDefaultLayoutProperty
Field Value
System.Windows.DependencyProperty
|
UseSpringAnimationsProperty
Identifies the UseSpringAnimations dependency property.
Declaration
public static readonly DependencyProperty UseSpringAnimationsProperty
Field Value
System.Windows.DependencyProperty
|
ZoomBarDropDownHeightProperty
Identifies the ZoomBarDropDownHeight dependency property.
Declaration
public static readonly DependencyProperty ZoomBarDropDownHeightProperty
Field Value
System.Windows.DependencyProperty
|
ZoomBarPresetsVisibilityProperty
Identifies the ZoomBarPresetsVisibility dependency property.
Declaration
public static readonly DependencyProperty ZoomBarPresetsVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
ZoomBarVisibilityProperty
Identifies the ZoomBarVisibility dependency property.
Declaration
public static readonly DependencyProperty ZoomBarVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
ZoomingFinishedEvent
Identifies the ZoomingFinished routed event.
Declaration
public static readonly RoutedEvent ZoomingFinishedEvent
Field Value
RoutedEvent
|
ZoomLevelProperty
Identifies the ZoomLevel ZoomLevel dependency property.
Declaration
public static readonly DependencyProperty ZoomLevelProperty
Field Value
System.Windows.DependencyProperty
|
ZoomProperty
Identifies the Zoom dependency property.
Declaration
public static readonly DependencyProperty ZoomProperty
Field Value
System.Windows.DependencyProperty
|
ZoomStepProperty
Identifies the ZoomStep dependency property.
Declaration
public static readonly DependencyProperty ZoomStepProperty
Field Value
System.Windows.DependencyProperty
|
Properties
Center
Gets or sets center of the map.
Declaration
public Location Center { get; set; }
Property Value
Location
|
CommandBarVisibility
Gets or sets visibility of the embedded MapCommandBar UI control.
Declaration
public Visibility CommandBarVisibility { get; set; }
Property Value
System.Windows.Visibility
|
DistanceUnit
Gets or sets distance unit.
Declaration
public DistanceUnit DistanceUnit { get; set; }
Property Value
DistanceUnit
|
GeoBounds
Gets or sets map geographical bounds.
Declaration
public LocationRect GeoBounds { get; set; }
Property Value
LocationRect
|
Remarks
You can't use this property to set bounds at the same time with GeoBoundsNW and GeoBoundsSE properties.
GeoBoundsNW
Gets or sets north-west corner of the map geographical bounds.
Declaration
public Location GeoBoundsNW { get; set; }
Property Value
Location
|
Remarks
You can't use this property to set bounds at the same time with GeoBounds property.
GeoBoundsSE
Gets or sets south-east corner of the map geographical bounds.
Declaration
public Location GeoBoundsSE { get; set; }
Property Value
Location
|
Remarks
You can't use this property to set bounds at the same time with GeoBounds property.
GeographicalBounds
Gets bounds of the geographical region covered by map control.
Declaration
public Rect GeographicalBounds { get; }
Property Value
System.Windows.Rect
|
IsInitialized
Gets value which indicates whether map control have been initialized.
Declaration
public bool IsInitialized { get; }
Property Value
System.Boolean
|
IsKeyboardNavigationEnabled
IsMiniMapExpanded
Gets or sets value which indicates whether the embedded MiniMap UI control is expanded.
Declaration
public bool IsMiniMapExpanded { get; set; }
Property Value
System.Boolean
|
LocationRect
Gets LocationRect of the geographical region covered by map control.
Declaration
public LocationRect LocationRect { get; }
Property Value
LocationRect
|
MapZoomBar
Gets the default zoom control.
Declaration
public MapZoomBar MapZoomBar { get; }
Property Value
MapZoomBar
The map zoom panel. |
MaxZoomLevel
Gets or sets maximum ZoomLevel.
Declaration
public int MaxZoomLevel { get; set; }
Property Value
System.Int32
|
MiniMapExpanderVisibility
Gets or sets visibility of the embedded MiniMapExpander UI control.
Declaration
public Visibility MiniMapExpanderVisibility { get; set; }
Property Value
System.Windows.Visibility
|
MiniMapHeight
Gets or sets height of the embedded MiniMap UI control.
Declaration
public double MiniMapHeight { get; set; }
Property Value
System.Double
|
MiniMapWidth
Gets or sets width of the embedded MiniMap UI control.
Declaration
public double MiniMapWidth { get; set; }
Property Value
System.Double
|
MinZoomLevel
Gets or sets minimum ZoomLevel.
Declaration
public int MinZoomLevel { get; set; }
Property Value
System.Int32
|
MouseClickMode
Gets or sets Mouse Click Mode property.
Declaration
public MouseBehavior MouseClickMode { get; set; }
Property Value
MouseBehavior
|
MouseDoubleClickMode
Gets or sets Mouse Double Click Mode property.
Declaration
public MouseBehavior MouseDoubleClickMode { get; set; }
Property Value
MouseBehavior
|
MouseDragMode
Gets or sets Mouse Drag Mode property.
Declaration
public MouseDragBehavior MouseDragMode { get; set; }
Property Value
MouseDragBehavior
|
MouseLocationIndicatorVisibility
Gets or sets visibility of the embedded MouseLocationIndicator UI control.
Declaration
public Visibility MouseLocationIndicatorVisibility { get; set; }
Property Value
System.Windows.Visibility
|
MouseSelectionMode
Gets or sets Mouse Selection Mode property.
Declaration
public MouseSelectionMode MouseSelectionMode { get; set; }
Property Value
MouseSelectionMode
|
MouseShiftDragMode
Gets or sets value which specify mouse dragging behaviour when SHIFT key is pressed.
Declaration
public MouseDragBehavior MouseShiftDragMode { get; set; }
Property Value
MouseDragBehavior
|
MouseWheelMode
Gets or sets the mode of mouse wheel.
Declaration
public MouseWheelBehavior MouseWheelMode { get; set; }
Property Value
MouseWheelBehavior
|
MouseWheelSensitivity
Gets or sets the sensitivity of mouse wheel.
Declaration
public double MouseWheelSensitivity { get; set; }
Property Value
System.Double
|
NavigationVisibility
PinchManipulationSensitivity
Gets or sets sensitivity of the pinch manipulation on the touch screens.
Declaration
public double PinchManipulationSensitivity { get; set; }
Property Value
System.Double
|
Remarks
The value must be in the [0..1] range.
Provider
Get or sets map provider.
Declaration
public MapProviderBase Provider { get; set; }
Property Value
MapProviderBase
|
Providers
Gets collection of the map image providers.
Declaration
public MapProviderCollection Providers { get; }
Property Value
MapProviderCollection
|
ScaleVisibility
Gets or sets visibility of the embedded MapScale UI control.
Declaration
public Visibility ScaleVisibility { get; set; }
Property Value
System.Windows.Visibility
|
SpatialReference
Gets or sets current Spatial Reference of the Map control.
Declaration
public ISpatialReference SpatialReference { get; set; }
Property Value
ISpatialReference
|
UseDefaultLayout
Gets or sets value which indicates whether map control should use default layout for navigation and map mode controls.
Declaration
public bool UseDefaultLayout { get; set; }
Property Value
System.Boolean
|
UseSpringAnimations
Gets or sets value which indicates whether spring animations are enabled.
Declaration
public bool UseSpringAnimations { get; set; }
Property Value
System.Boolean
|
Zoom
Gets or sets the current zoom. Should be value between 1.0 and 20.0. It automatically sets the ZoomLevel to the biggest integer which is below the current double value.
Declaration
public double Zoom { get; set; }
Property Value
System.Double
|
ZoomBarDropDownHeight
Gets or sets height of the embedded MapZoomBar drop down.
Declaration
public double ZoomBarDropDownHeight { get; set; }
Property Value
System.Double
|
ZoomBarPresetsVisibility
Gets or sets the visibility of the MapZoomBar preset buttons that zoom to predefined levels on the map (World, State, Region, City, Hood).
Declaration
public Visibility ZoomBarPresetsVisibility { get; set; }
Property Value
System.Windows.Visibility
|
ZoomBarVisibility
Gets or sets visibility of the embedded MapZoomBar UI control.
Declaration
public Visibility ZoomBarVisibility { get; set; }
Property Value
System.Windows.Visibility
|
ZoomLevel
Gets or sets zoom level.
Declaration
public int ZoomLevel { get; set; }
Property Value
System.Int32
|
ZoomStep
Gets or sets a value indicating the zoom step when zooming with mouse or map zoom bar control.
Declaration
public double ZoomStep { get; set; }
Property Value
System.Double
|
Methods
add_MapMouseClick(MouseRoutedEventHandler)
Declaration
public void add_MapMouseClick(MouseRoutedEventHandler value)
Parameters
MouseRoutedEventHandler
value
|
add_MapMouseDoubleClick(MouseRoutedEventHandler)
Declaration
public void add_MapMouseDoubleClick(MouseRoutedEventHandler value)
Parameters
MouseRoutedEventHandler
value
|
ArrangeOverride(Size)
Called to arrange and size the content.
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
System.Windows.Size
finalSize
The computed size that is used to arrange the content. |
Returns
System.Windows.Size
The calculated size. |
ClearContainerForItemOverride(DependencyObject, Object)
Undoes the effects of the PrepareContainerForItemOverride method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
The container element. |
System.Object
item
The item. |
Dispose()
Dispose all resources are used by RadMap control.
Declaration
public void Dispose()
GetGeoSize(Location, Size)
Calculates degree size according to base point and zoom.
Declaration
public Size GetGeoSize(Location basePoint, Size pixelSize)
Parameters
Location
basePoint
Base point. |
System.Windows.Size
pixelSize
The size in pixels. |
Returns
System.Windows.Size
Size in degree. |
Examples
This example demonstrates how GetGeoSize method can be used to calculate one location from another using pixel distance between 2 points.
Location firstLocation = new Location(40, -100);
double distanceX = 10; // 10 pixels
double distanceY = 20; // 20 pixels
Size pixelSize = new Size(Math.Abs(distanceX), Math.Abs(distanceY));
Size geoSize = this.radMap.GetGeoSize(firstLocation, pixelSize);
Location secondLocation = new Location(
firstLocation.Latitude - Math.Sign(distanceY) * geoSize.Height,
firstLocation.Longitude + Math.Sign(distanceX) * geoSize.Width);
Dim firstLocation As New Location(40, -100)
Dim distanceX As Double = 10 ' 10 pixels
Dim distanceY As Double = 20 ' 20 pixels
Dim pixelSize As New Size(Math.Abs(distanceX), Math.Abs(distanceY))
Dim geoSize As Size = Me.radMap.GetGeoSize(firstLocation, pixelSize)
Dim secondLocation As New Location( _
firstLocation.Latitude - Math.Sign(distanceY) * geoSize.Height, _
firstLocation.Longitude + Math.Sign(distanceX) * geoSize.Width)
GetLatitudeLongitudeSize(Location, Double, Double)
Calculates degree size according to base point and zoom.
Declaration
public Size GetLatitudeLongitudeSize(Location basePoint, double width, double height)
Parameters
Location
basePoint
Base point. |
System.Double
width
The width in units according to DistanceUnit property. |
System.Double
height
The height in units according to DistanceUnit property. |
Returns
System.Windows.Size
Size in degree. |
GetPixelsDistance(Double)
Calculates horizontal pixel distance according to latitude and zoom.
Declaration
public double GetPixelsDistance(double distance)
Parameters
System.Double
distance
The distance in units according to DistanceUnit property. |
Returns
System.Double
Horizontal distance in pixels. |
GetPixelSize(Location, Double, Double)
Calculates pixel size according to base point and zoom.
Declaration
public Size GetPixelSize(Location basePoint, double width, double height)
Parameters
Location
basePoint
Base point. |
System.Double
width
The width in units according to DistanceUnit property. |
System.Double
height
The height in units according to DistanceUnit property. |
Returns
System.Windows.Size
Size in pixels. |
GetPixelSizeAtZoomLevel(LocationRect, Int32)
Gets pixel size of the specified geographic region for the given zoom level.
Declaration
public Size GetPixelSizeAtZoomLevel(LocationRect geoRegion, int zoomLevel)
Parameters
LocationRect
geoRegion
Geographical region to get pixel size for. |
System.Int32
zoomLevel
Zoom level. |
Returns
System.Windows.Size
Pixel size of the region. |
IsVisible(Location)
Detect whether given location is visible in the map control.
Declaration
public bool IsVisible(Location location)
Parameters
Location
location
|
Returns
System.Boolean
|
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()
Overrides
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
Element used to display the specified item. |
System.Object
item
Specified item. |
Overrides
RefreshCommandBar()
Refresh default command bar regardless whether map provider has been changed or not.
Declaration
public void RefreshCommandBar()
remove_MapMouseClick(MouseRoutedEventHandler)
Declaration
public void remove_MapMouseClick(MouseRoutedEventHandler value)
Parameters
MouseRoutedEventHandler
value
|
remove_MapMouseDoubleClick(MouseRoutedEventHandler)
Declaration
public void remove_MapMouseDoubleClick(MouseRoutedEventHandler value)
Parameters
MouseRoutedEventHandler
value
|
SetView(LocationRect, Boolean)
Sets ZoomLevel and Center so the given LocationRect object is completely visible.
Declaration
public void SetView(LocationRect view, bool useFractionZoom = false)
Parameters
LocationRect
view
The location rect that should be centered in the map viewport. |
System.Boolean
useFractionZoom
Sets a value indicating whether the zooming of the view should use the fractional part of calculated zoom level. |
SetView(LocationRect, Double)
Sets ZoomLevel and Center so the given LocationRect object, including minimum padding around it is completely visible in viewport. After this operation, zoom property is expected to have non-integer value with fractional digits.
Declaration
public void SetView(LocationRect view, double minimumPadding)
Parameters
LocationRect
view
The location rect that should be centered in the map viewport. |
System.Double
minimumPadding
Sets a value indicating the the minimum padding around the visible view, in pixels. |
Events
CenterChanged
Event occurs when the Center property of the map control is changed.
Declaration
public event EventHandler CenterChanged
Event Type
System.EventHandler
|
CenterChanging
Event occurs when the Center property of the map control starts to change.
Declaration
public event EventHandler<PropertyChangingEventArgs> CenterChanging
Event Type
System.EventHandler<PropertyChangingEventArgs>
|
InitializeCompleted
Event occurs when initialization of the map control is completed.
Declaration
public event EventHandler InitializeCompleted
Event Type
System.EventHandler
|
MapMouseClick
Occurs when the user clicks on the map.
Declaration
public event MouseRoutedEventHandler MapMouseClick
Event Type
MouseRoutedEventHandler
|
MapMouseDoubleClick
Occurs when the user does double click on the map.
Declaration
public event MouseRoutedEventHandler MapMouseDoubleClick
Event Type
MouseRoutedEventHandler
|
PanningFinished
Event occurs when panning of the map finished (spring animation which started when map center has been changed is finished).
Declaration
public event RoutedEventHandler PanningFinished
Event Type
System.Windows.RoutedEventHandler
|
SelectionRectangleChanged
Event occurs when new geographical region is selected by mouse (the MouseDragBehavior is "Select" and MouseSelectionMode is "RaiseEvent").
Declaration
public event EventHandler<SelectionRectangleChangedEventArgs> SelectionRectangleChanged
Event Type
System.EventHandler<SelectionRectangleChangedEventArgs>
|
ZoomChanged
Event occurs when the Zoom property of the map control is changed.
Declaration
public event EventHandler ZoomChanged
Event Type
System.EventHandler
|
ZoomChanging
Event occurs when the ZoomLevel property of the map control starts to change.
Declaration
public event EventHandler<PropertyChangingEventArgs> ZoomChanging
Event Type
System.EventHandler<PropertyChangingEventArgs>
|
ZoomingFinished
Event occurs when zooming of the map finished (spring animation which started when map zoom level has been changed is finished).
Declaration
public event RoutedEventHandler ZoomingFinished
Event Type
System.Windows.RoutedEventHandler
|