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

RadMap

Class

Represents the RadMap class.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
[TelerikToolboxCategory("Data Visualization")]
public class RadMap : ItemsControl

Inheritance: objectRadMap

Derived Classes: MiniMap

Constructors

Initializes a new instance of the RadMap class.

C#
public RadMap()

Fields

CenterProperty

DependencyProperty

Identifies the Center Center dependency property.

C#
public static readonly DependencyProperty CenterProperty

Identifies the CommandBarVisibility dependency property.

C#
public static readonly DependencyProperty CommandBarVisibilityProperty

DistanceUnitProperty

DependencyProperty

Identifies the DistanceUnit DistanceUnit dependency property.

C#
public static readonly DependencyProperty DistanceUnitProperty

GeoBoundsNWProperty

DependencyProperty

Identifies the GeoBoundsNW GeoBoundsNW dependency property.

C#
public static readonly DependencyProperty GeoBoundsNWProperty

GeoBoundsProperty

DependencyProperty

Identifies the GeoBounds GeoBounds dependency property.

C#
public static readonly DependencyProperty GeoBoundsProperty

GeoBoundsSEProperty

DependencyProperty

Identifies the GeoBoundsSE GeoBoundsSE dependency property.

C#
public static readonly DependencyProperty GeoBoundsSEProperty

Identifies the IsKeyboardNavigationEnabled dependency property.

C#
public static readonly DependencyProperty IsKeyboardNavigationEnabledProperty

IsMiniMapExpandedProperty

DependencyProperty

Identifies the IsMiniMapExpanded dependency property.

C#
public static readonly DependencyProperty IsMiniMapExpandedProperty

Identifies the MapMouseClick routed event.

C#
public static readonly RoutedEvent MapMouseClickEvent

Identifies the MapMouseDoubleClick routed event.

C#
public static readonly RoutedEvent MapMouseDoubleClickEvent

MaxZoomLevelProperty

DependencyProperty

Identifies the MaxZoomLevel dependency property.

C#
public static readonly DependencyProperty MaxZoomLevelProperty

Identifies the MiniMapExpanderVisibility dependency property.

C#
public static readonly DependencyProperty MiniMapExpanderVisibilityProperty

MiniMapHeightProperty

DependencyProperty

Identifies the MiniMapHeight dependency property.

C#
public static readonly DependencyProperty MiniMapHeightProperty

MiniMapWidthProperty

DependencyProperty

Identifies the MiniMapWidth dependency property.

C#
public static readonly DependencyProperty MiniMapWidthProperty

MinZoomLevelProperty

DependencyProperty

Identifies the MinZoomLevel dependency property.

C#
public static readonly DependencyProperty MinZoomLevelProperty

MouseClickModeProperty

DependencyProperty

Identifies the MouseClickMode dependency property.

C#
public static readonly DependencyProperty MouseClickModeProperty

Identifies the MouseDoubleClickMode dependency property.

C#
public static readonly DependencyProperty MouseDoubleClickModeProperty

MouseDragModeProperty

DependencyProperty

Identifies the MouseDragMode dependency property.

C#
public static readonly DependencyProperty MouseDragModeProperty

Identifies the MouseLocationIndicatorVisibility dependency property.

C#
public static readonly DependencyProperty MouseLocationIndicatorVisibilityProperty

MouseSelectionModeProperty

DependencyProperty

Identifies the MouseSelectionMode dependency property.

C#
public static readonly DependencyProperty MouseSelectionModeProperty

MouseShiftDragModeProperty

DependencyProperty

Identifies the MouseShiftDragMode dependency property.

C#
public static readonly DependencyProperty MouseShiftDragModeProperty

MouseWheelModeProperty

DependencyProperty

Identifies the MouseWheelMode dependency property.

C#
public static readonly DependencyProperty MouseWheelModeProperty

Identifies the MouseWheelSensitivity dependency property.

C#
public static readonly DependencyProperty MouseWheelSensitivityProperty

Identifies the NavigationVisibility dependency property.

C#
public static readonly DependencyProperty NavigationVisibilityProperty

Identifies the PanningFinished routed event.

C#
public static readonly RoutedEvent PanningFinishedEvent

ProviderProperty

DependencyProperty

Identifies the Provider Provider dependency property.

C#
public static readonly DependencyProperty ProviderProperty

ProvidersProperty

DependencyProperty

Identifies the Providers dependency property.

C#
public static readonly DependencyProperty ProvidersProperty

ScaleVisibilityProperty

DependencyProperty

Identifies the ScaleVisibility dependency property.

C#
public static readonly DependencyProperty ScaleVisibilityProperty

Identifies the SpringAnimationsMode dependency property.

C#
public static readonly DependencyProperty SpringAnimationsModeProperty

UseDefaultLayoutProperty

DependencyProperty

Identifies the UseDefaultLayout dependency property.

C#
public static readonly DependencyProperty UseDefaultLayoutProperty

UseSpringAnimationsProperty

DependencyProperty

Identifies the UseSpringAnimations dependency property.

C#
public static readonly DependencyProperty UseSpringAnimationsProperty

WrapAroundProperty

DependencyProperty

Identifies the WrapAround dependency property.

C#
public static readonly DependencyProperty WrapAroundProperty

Identifies the ZoomBarDropDownHeight dependency property.

C#
public static readonly DependencyProperty ZoomBarDropDownHeightProperty

Identifies the ZoomBarPresetsVisibility dependency property.

C#
public static readonly DependencyProperty ZoomBarPresetsVisibilityProperty

ZoomBarVisibilityProperty

DependencyProperty

Identifies the ZoomBarVisibility dependency property.

C#
public static readonly DependencyProperty ZoomBarVisibilityProperty

Identifies the ZoomingFinished routed event.

C#
public static readonly RoutedEvent ZoomingFinishedEvent

ZoomLevelProperty

DependencyProperty

Identifies the ZoomLevel ZoomLevel dependency property.

C#
public static readonly DependencyProperty ZoomLevelProperty

ZoomProperty

DependencyProperty

Identifies the Zoom dependency property.

C#
public static readonly DependencyProperty ZoomProperty

ZoomStepProperty

DependencyProperty

Identifies the ZoomStep dependency property.

C#
public static readonly DependencyProperty ZoomStepProperty

Properties

Gets or sets center of the map. In WrapAround mode Center's Longitude exceeds boundaries (-180; 180). To coerce it you can use the method GetCoercedLocation(Location).

C#
public Location Center { get; set; }

Gets or sets visibility of the embedded MapCommandBar UI control.

C#
public Visibility CommandBarVisibility { get; set; }

Gets or sets distance unit.

C#
public DistanceUnit DistanceUnit { get; set; }

Gets or sets map geographical bounds.

C#
public LocationRect GeoBounds { get; set; }
Remarks:

You can't use this property to set bounds at the same time with GeoBoundsNW and GeoBoundsSE properties.

Gets or sets north-west corner of the map geographical bounds.

C#
public Location GeoBoundsNW { get; set; }
Remarks:

You can't use this property to set bounds at the same time with GeoBounds property.

Gets or sets south-east corner of the map geographical bounds.

C#
public Location GeoBoundsSE { get; set; }
Remarks:

You can't use this property to set bounds at the same time with GeoBounds property.

Gets bounds of the geographical region covered by map control.

C#
public Rect GeographicalBounds { get; }

Gets value which indicates whether map control have been initialized.

C#
public bool IsInitialized { get; }

Gets or sets value which indicates whether keyboard can be used to navigate over the map.

C#
public bool IsKeyboardNavigationEnabled { get; set; }

Gets or sets value which indicates whether the embedded MiniMap UI control is expanded.

C#
public bool IsMiniMapExpanded { get; set; }

Gets LocationRect of the geographical region covered by map control.

C#
public LocationRect LocationRect { get; }

Gets the default zoom control.

C#
public MapZoomBar MapZoomBar { get; }
Property Value:

The map zoom panel.

Gets or sets maximum ZoomLevel.

C#
public int MaxZoomLevel { get; set; }

Gets or sets visibility of the embedded MiniMapExpander UI control.

C#
public Visibility MiniMapExpanderVisibility { get; set; }

Gets or sets height of the embedded MiniMap UI control.

C#
public double MiniMapHeight { get; set; }

Gets or sets width of the embedded MiniMap UI control.

C#
public double MiniMapWidth { get; set; }

Gets or sets minimum ZoomLevel.

C#
public int MinZoomLevel { get; set; }

Gets or sets Mouse Click Mode property.

C#
public MouseBehavior MouseClickMode { get; set; }

Gets or sets Mouse Double Click Mode property.

C#
public MouseBehavior MouseDoubleClickMode { get; set; }

Gets or sets Mouse Drag Mode property.

C#
public MouseDragBehavior MouseDragMode { get; set; }

Gets or sets visibility of the embedded MouseLocationIndicator UI control.

C#
public Visibility MouseLocationIndicatorVisibility { get; set; }

Gets or sets Mouse Selection Mode property.

C#
public MouseSelectionMode MouseSelectionMode { get; set; }

Gets or sets value which specify mouse dragging behaviour when SHIFT key is pressed.

C#
public MouseDragBehavior MouseShiftDragMode { get; set; }

Gets or sets the mode of mouse wheel.

C#
public MouseWheelBehavior MouseWheelMode { get; set; }

Gets or sets the sensitivity of mouse wheel.

C#
public double MouseWheelSensitivity { get; set; }

Gets or sets visibility of the embedded MapNavigation UI control (the arrows navigation).

C#
public Visibility NavigationVisibility { get; set; }

Gets or sets sensitivity of the pinch manipulation on the touch screens.

C#
public double PinchManipulationSensitivity { get; set; }
Remarks:

The value must be in the [0..1] range.

Get or sets map provider.

C#
public MapProviderBase Provider { get; set; }

Gets collection of the map image providers.

C#
public MapProviderCollection Providers { get; }

ScaleVisibility

Visibility

Gets or sets visibility of the embedded MapScale UI control.

C#
public Visibility ScaleVisibility { get; set; }

Gets or sets current Spatial Reference of the Map control.

C#
public ISpatialReference SpatialReference { get; set; }

Gets or sets mode of map animation.

C#
public SpringAnimationsMode SpringAnimationsMode { get; set; }

Gets or sets value which indicates whether map control should use default layout for navigation and map mode controls.

C#
public bool UseDefaultLayout { get; set; }

Gets or sets value which indicates whether spring animations are enabled.

C#
public bool UseSpringAnimations { get; set; }

Gets or sets a value indicating whether Map Wraparound Mode is Enabled. When in WrapAround mode - the map always covers the viewport horizontally, panning can be considered unlimited.

C#
public bool WrapAround { get; set; }

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.

C#
public double Zoom { get; set; }

Gets or sets height of the embedded MapZoomBar drop down.

C#
public double ZoomBarDropDownHeight { get; set; }

Gets or sets the visibility of the MapZoomBar preset buttons that zoom to predefined levels on the map (World, State, Region, City, Hood).

C#
public Visibility ZoomBarPresetsVisibility { get; set; }

Gets or sets visibility of the embedded MapZoomBar UI control.

C#
public Visibility ZoomBarVisibility { get; set; }

Gets or sets zoom level.

C#
public int ZoomLevel { get; set; }

Gets or sets a value indicating the zoom step when zooming with mouse or map zoom bar control.

C#
public double ZoomStep { get; set; }

Methods

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.

Undoes the effects of the PrepareContainerForItemOverride method.

C#
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

The container element.

itemobject

The item.

Dispose all resources are used by RadMap control.

C#
public void Dispose()

Exports the current viewport of the map into a steam.

C#
public void ExportToImage(Stream stream, bool includeMapObjects = false, BitmapEncoder encoder = null)
Parameters:streamStream

The stream to which the map should be exported.

includeMapObjectsbool

Indicates whether to include or not the objects from the information / visualization layers.

encoderBitmapEncoder

The encoder used for the export.

Exports the current viewport of the map into a file with the given fileName parameter.

C#
public void ExportToImage(string fileName, bool includeMapObjects = false, BitmapEncoder encoder = null)
Parameters:fileNamestring

The name of the file to which the map should be exported.

includeMapObjectsbool

Indicates whether to include or not the objects from the information / visualization layers.

encoderBitmapEncoder

The encoder used for the export.

Gets a Location in longitude range(-180;180) by shifting the given location's longitude.

C#
public Location GetCoercedLocation(Location location)
Parameters:locationLocationReturns:

Location

Gets a LocationRect whose West is in longitude range(-180;180) by shifting the given LocationRect West longitude.

C#
public LocationRect GetCoercedLocationRect(LocationRect baseRect)
Parameters:baseRectLocationRectReturns:

LocationRect

Calculates degree size according to base point and zoom.

C#
public Size GetGeoSize(Location basePoint, Size pixelSize)
Parameters:basePointLocation

Base point.

pixelSizeSize

The size in pixels.

Returns:

Size

Size in degree.

Calculates degree size according to base point and zoom.

C#
public Size GetLatitudeLongitudeSize(Location basePoint, double width, double height)
Parameters:basePointLocation

Base point.

widthdouble

The width in units according to DistanceUnit property.

heightdouble

The height in units according to DistanceUnit property.

Returns:

Size

Size in degree.

Calculates horizontal pixel distance according to latitude and zoom.

C#
public double GetPixelsDistance(double distance)
Parameters:distancedouble

The distance in units according to DistanceUnit property.

Returns:

double

Horizontal distance in pixels.

Calculates pixel size according to base point and zoom.

C#
public Size GetPixelSize(Location basePoint, double width, double height)
Parameters:basePointLocation

Base point.

widthdouble

The width in units according to DistanceUnit property.

heightdouble

The height in units according to DistanceUnit property.

Returns:

Size

Size in pixels.

Gets pixel size of the specified geographic region for the given zoom level.

C#
public Size GetPixelSizeAtZoomLevel(LocationRect geoRegion, int zoomLevel)
Parameters:geoRegionLocationRect

Geographical region to get pixel size for.

zoomLevelint

Zoom level.

Returns:

Size

Pixel size of the region.

Gets a Location shifted with offset equal to the offset by which the current center is shifted outside longitude range (-180;180).

C#
public Location GetShiftedLocation(Location baseLocation, Location? center = null)
Parameters:baseLocationLocationcenterLocation?Returns:

Location

Detect whether given location is visible in the map control.

C#
public bool IsVisible(Location location)
Parameters:locationLocationReturns:

bool

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()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

The type-specific AutomationPeer implementation.

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Handles the routed event.

C#
protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The event data.

The MouseWheel event handler.

C#
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters:eMouseWheelEventArgs

Event arguments.

Prepares the specified element to display the specified item.

C#
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

Element used to display the specified item.

itemobject

Specified item.

Refresh default command bar regardless whether map provider has been changed or not.

C#
public void RefreshCommandBar()

Sets ZoomLevel and Center so the given LocationRect object is completely visible.

C#
public void SetView(LocationRect view, bool useFractionZoom = false)
Parameters:viewLocationRect

The location rect that should be centered in the map viewport.

useFractionZoombool

Sets a value indicating whether the zooming of the view should use the fractional part of calculated zoom level.

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.

C#
public void SetView(LocationRect view, double minimumPadding)
Parameters:viewLocationRect

The location rect that should be centered in the map viewport.

minimumPaddingdouble

Sets a value indicating the the minimum padding around the visible view, in pixels.

Events

Event occurs when the Center property of the map control is changed.

C#
public event EventHandler CenterChanged

Event occurs when the Center property of the map control starts to change.

C#
public event EventHandler<PropertyChangingEventArgs> CenterChanging

Event occurs when initialization of the map control is completed.

C#
public event EventHandler InitializeCompleted

Occurs when the user clicks on the map.

C#
public event MouseRoutedEventHandler MapMouseClick

Occurs when the user does double click on the map.

C#
public event MouseRoutedEventHandler MapMouseDoubleClick

PanningFinished

RoutedEventHandler

Event occurs when panning of the map finished (spring animation which started when map center has been changed is finished).

C#
public event RoutedEventHandler PanningFinished

Event occurs when new geographical region is selected by mouse (the MouseDragBehavior is "Select" and MouseSelectionMode is "RaiseEvent").

C#
public event EventHandler<SelectionRectangleChangedEventArgs> SelectionRectangleChanged

Event occurs when the Zoom property of the map control is changed.

C#
public event EventHandler ZoomChanged

Event occurs when the ZoomLevel property of the map control starts to change.

C#
public event EventHandler<PropertyChangingEventArgs> ZoomChanging

ZoomingFinished

RoutedEventHandler

Event occurs when zooming of the map finished (spring animation which started when map zoom level has been changed is finished).

C#
public event RoutedEventHandler ZoomingFinished
In this article
DefinitionConstructorsRadMap()FieldsCenterPropertyCommandBarVisibilityPropertyDistanceUnitPropertyGeoBoundsNWPropertyGeoBoundsPropertyGeoBoundsSEPropertyIsKeyboardNavigationEnabledPropertyIsMiniMapExpandedPropertyMapMouseClickEventMapMouseDoubleClickEventMaxZoomLevelPropertyMiniMapExpanderVisibilityPropertyMiniMapHeightPropertyMiniMapWidthPropertyMinZoomLevelPropertyMouseClickModePropertyMouseDoubleClickModePropertyMouseDragModePropertyMouseLocationIndicatorVisibilityPropertyMouseSelectionModePropertyMouseShiftDragModePropertyMouseWheelModePropertyMouseWheelSensitivityPropertyNavigationVisibilityPropertyPanningFinishedEventProviderPropertyProvidersPropertyScaleVisibilityPropertySpringAnimationsModePropertyUseDefaultLayoutPropertyUseSpringAnimationsPropertyWrapAroundPropertyZoomBarDropDownHeightPropertyZoomBarPresetsVisibilityPropertyZoomBarVisibilityPropertyZoomingFinishedEventZoomLevelPropertyZoomPropertyZoomStepPropertyPropertiesCenterCommandBarVisibilityDistanceUnitGeoBoundsGeoBoundsNWGeoBoundsSEGeographicalBoundsIsInitializedIsKeyboardNavigationEnabledIsMiniMapExpandedLocationRectMapZoomBarMaxZoomLevelMiniMapExpanderVisibilityMiniMapHeightMiniMapWidthMinZoomLevelMouseClickModeMouseDoubleClickModeMouseDragModeMouseLocationIndicatorVisibilityMouseSelectionModeMouseShiftDragModeMouseWheelModeMouseWheelSensitivityNavigationVisibilityPinchManipulationSensitivityProviderProvidersScaleVisibilitySpatialReferenceSpringAnimationsModeUseDefaultLayoutUseSpringAnimationsWrapAroundZoomZoomBarDropDownHeightZoomBarPresetsVisibilityZoomBarVisibilityZoomLevelZoomStepMethodsArrangeOverride(Size)ClearContainerForItemOverride(DependencyObject, object)Dispose()ExportToImage(Stream, bool, BitmapEncoder)ExportToImage(string, bool, BitmapEncoder)GetCoercedLocation(Location)GetCoercedLocationRect(LocationRect)GetGeoSize(Location, Size)GetLatitudeLongitudeSize(Location, double, double)GetPixelsDistance(double)GetPixelSize(Location, double, double)GetPixelSizeAtZoomLevel(LocationRect, int)GetShiftedLocation(Location, Location?)IsVisible(Location)OnApplyTemplate()OnCreateAutomationPeer()OnInitialized(EventArgs)OnMouseDoubleClick(MouseButtonEventArgs)OnMouseWheel(MouseWheelEventArgs)PrepareContainerForItemOverride(DependencyObject, object)RefreshCommandBar()SetView(LocationRect, bool)SetView(LocationRect, double)EventsCenterChangedCenterChangingInitializeCompletedMapMouseClickMapMouseDoubleClickPanningFinishedSelectionRectangleChangedZoomChangedZoomChangingZoomingFinished
Not finding the help you need?
Contact Support