Class MiniMapElement
Represents a mini map element that provides an overview of the main map with viewport control, zoom management, and interactive navigation capabilities.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public class MiniMapElement : BaseMapElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IMapViewport
Constructors
MiniMapElement()
Initializes a new instance of the MiniMapElement class with default input behavior for interactive mini map navigation.
Declaration
public MiniMapElement()
Fields
isBringIntoView
Declaration
protected bool isBringIntoView
Field Value
|
System.Boolean
|
suspendViewportUpdates
Declaration
protected bool suspendViewportUpdates
Field Value
|
System.Boolean
|
ViewportControlBackColorProperty
Identifies the ViewportControlBackColor dependency property that defines the background color of the viewport control rectangle.
Declaration
public static RadProperty ViewportControlBackColorProperty
Field Value
|
RadProperty
|
ViewportControlBorderColorProperty
Identifies the ViewportControlBorderColor dependency property that defines the border color of the viewport control rectangle.
Declaration
public static RadProperty ViewportControlBorderColorProperty
Field Value
|
RadProperty
|
Properties
IsAnimating
Gets a value indicating whether a collapse or expand animation is currently active, preventing user interactions during the transition.
Declaration
public bool IsAnimating { get; protected set; }
Property Value
|
System.Boolean
|
IsCollapsed
Gets or sets a value indicating whether the mini map is currently collapsed to show only the toggle button.
Declaration
public bool IsCollapsed { get; set; }
Property Value
|
System.Boolean
|
MapElement
Gets the main map element that this mini map is associated with for synchronization and viewport management.
Declaration
public RadMapElement MapElement { get; }
Property Value
|
RadMapElement
|
MiniMapMode
Gets or sets the mini map display mode that determines how the mini map behaves in relation to the main map zoom level and viewport.
Declaration
public MiniMapMode MiniMapMode { get; set; }
Property Value
|
MiniMapMode
|
MiniMapSize
Gets or sets the size of the mini map display area, automatically scaled for DPI settings with layout invalidation support.
Declaration
public Size MiniMapSize { get; set; }
Property Value
|
System.Drawing.Size
|
ToggleMiniMapButton
Gets the toggle button element that allows users to expand or collapse the mini map display.
Declaration
public MiniMapToggleButtonElement ToggleMiniMapButton { get; }
Property Value
|
MiniMapToggleButtonElement
|
ViewportControlBackColor
Gets or sets the background color of the viewport control rectangle that represents the main map's visible area within the mini map.
Declaration
public Color ViewportControlBackColor { get; set; }
Property Value
|
System.Drawing.Color
|
ViewportControlBorderColor
Gets or sets the border color of the viewport control rectangle that represents the main map's visible area within the mini map.
Declaration
public Color ViewportControlBorderColor { get; set; }
Property Value
|
System.Drawing.Color
|
ZoomLevel
Gets or sets the current zoom level of the mini map, with special handling for WholeWorld mode where zoom level is fixed at 1.
Declaration
public override int ZoomLevel { get; set; }
Property Value
|
System.Int32
|
Overrides
ZoomOffset
Gets or sets the zoom offset used to calculate the mini map zoom level relative to the main map when MiniMapMode is set to OffsetZoom.
Declaration
public int ZoomOffset { get; set; }
Property Value
|
System.Int32
|
Methods
ArrangeOverride(SizeF)
Arranges the mini map child elements within the specified final size, positioning the toggle button in the top-right corner.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The System.Drawing.SizeF representing the final arrangement size for the mini map. |
Returns
|
System.Drawing.SizeF
A System.Drawing.SizeF representing the actual arranged size of the mini map. |
Overrides
BringIntoView(PointG)
Brings the specified geographic location into view by centering the mini map viewport on that location.
Declaration
public override void BringIntoView(PointG location)
Parameters
|
PointG
location
The PointG geographic location to bring into view. |
Overrides
CalculateViewport(SizeF)
Calculates the viewport dimensions and geographic bounds based on the current mini map mode and final size.
Declaration
protected override void CalculateViewport(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The System.Drawing.SizeF representing the final size for viewport calculation. |
Overrides
Collapse()
Collapses the mini map to show only the toggle button using animated size transition.
Declaration
public virtual void Collapse()
CreateChildElements()
Creates and initializes the child elements of the mini map, including the toggle button for expand/collapse functionality.
Declaration
protected override void CreateChildElements()
Overrides
CreateToggleMiniMapButton()
Creates and configures the toggle button element for expanding and collapsing the mini map display.
Declaration
protected virtual MiniMapToggleButtonElement CreateToggleMiniMapButton()
Returns
|
MiniMapToggleButtonElement
A configured MiniMapToggleButtonElement for mini map visibility control. |
DrawViewportControlRectangle(IGraphics, Single, SizeF)
Draws the viewport control rectangle that represents the main map's visible area within the mini map display.
Declaration
protected virtual void DrawViewportControlRectangle(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The IGraphics object used for drawing the viewport rectangle. |
|
System.Single
angle
The rotation angle for the element. |
|
System.Drawing.SizeF
scale
The scaling factor for the element. |
Expand()
Expands the mini map to show the full map display using animated size transition.
Declaration
public virtual void Expand()
InitializeFields()
Initializes the default field values and visual properties for the mini map element, including border settings and size configuration.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the required size for the mini map element, handling collapsed state and animation constraints.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
|
System.Drawing.SizeF
availableSize
The System.Drawing.SizeF representing the available space for measurement. |
Returns
|
System.Drawing.SizeF
A System.Drawing.SizeF representing the required size for the mini map display. |
Overrides
OnCollapseAnimationFinished(Object, AnimationStatusEventArgs)
Handles the completion of the collapse animation, finalizing the collapsed state and updating the toggle button state.
Declaration
protected virtual void OnCollapseAnimationFinished(object sender, AnimationStatusEventArgs e)
Parameters
|
System.Object
sender
The source of the event. |
|
AnimationStatusEventArgs
e
An AnimationStatusEventArgs containing the animation completion information. |
OnExpandAnimationFinished(Object, AnimationStatusEventArgs)
Handles the completion of the expand animation, finalizing the expanded state and updating the toggle button state.
Declaration
protected virtual void OnExpandAnimationFinished(object sender, AnimationStatusEventArgs e)
Parameters
|
System.Object
sender
The source of the event. |
|
AnimationStatusEventArgs
e
An AnimationStatusEventArgs containing the animation completion information. |
OnMapElementViewportChanged(Object, ViewportChangedEventArgs)
Handles viewport changes from the main map element, synchronizing the mini map display when in OffsetZoom mode.
Declaration
protected virtual void OnMapElementViewportChanged(object sender, ViewportChangedEventArgs e)
Parameters
|
System.Object
sender
The source of the event. |
|
ViewportChangedEventArgs
e
A ViewportChangedEventArgs containing the viewport change information. |
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change notifications, specifically managing layout invalidation when the MaxSize property changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
A RadPropertyChangedEventArgs containing the property change information. |
Overrides
OnProviderInitializationComplete(IMapProvider)
Handles the completion of map provider initialization by cloning the provider for mini map use and updating the viewport display.
Declaration
public override void OnProviderInitializationComplete(IMapProvider mapProvider)
Parameters
|
IMapProvider
mapProvider
The IMapProvider that has completed initialization. |
Overrides
OnToggleMiniMapButtonToggleStateChanged(Object, StateChangedEventArgs)
Handles the toggle button state changed event, triggering expand or collapse operations based on the new toggle state.
Declaration
protected virtual void OnToggleMiniMapButtonToggleStateChanged(object sender, StateChangedEventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
StateChangedEventArgs
args
A StateChangedEventArgs containing the new state information. |
OnToggleMiniMapButtonToggleStateChanging(Object, StateChangingEventArgs)
Handles the toggle button state changing event, preventing state changes during animation transitions.
Declaration
protected virtual void OnToggleMiniMapButtonToggleStateChanging(object sender, StateChangingEventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
StateChangingEventArgs
args
A StateChangingEventArgs containing the state change information. |
PaintDynamicMiniMap(IGraphics, Single, SizeF)
Paints the mini map in OffsetZoom mode with clipping and viewport control rectangle overlay.
Declaration
protected virtual void PaintDynamicMiniMap(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering the mini map. |
|
System.Single
angle
The rotation angle for the element. |
|
System.Drawing.SizeF
scale
The scaling factor for the element. |
PaintElement(IGraphics)
Overrides the base paint element method to prevent default painting behavior in favor of mode-specific rendering.
Declaration
protected override void PaintElement(IGraphics graphics)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering. |
Overrides
PaintElement(IGraphics, Single, SizeF)
Paints the mini map element with mode-specific rendering logic and viewport control rectangle display.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering the mini map. |
|
System.Single
angle
The rotation angle for the element. |
|
System.Drawing.SizeF
scale
The scaling factor for the element. |
Overrides
PaintProvidersContent(IGraphics)
Paints the content from map providers, with caching support during animations for improved performance.
Declaration
protected override void PaintProvidersContent(IGraphics graphics)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering provider content. |
Overrides
PaintStaticMiniMap(IGraphics, Single, SizeF)
Paints the mini map in StaticZoom mode with clipping and viewport control rectangle overlay.
Declaration
protected virtual void PaintStaticMiniMap(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering the mini map. |
|
System.Single
angle
The rotation angle for the element. |
|
System.Drawing.SizeF
scale
The scaling factor for the element. |
PaintWholeWorldMiniMap(IGraphics, Single, SizeF)
Paints the mini map in WholeWorld mode with scaled rendering and viewport control rectangle overlay.
Declaration
protected virtual void PaintWholeWorldMiniMap(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The IGraphics object used for rendering the mini map. |
|
System.Single
angle
The rotation angle for the element. |
|
System.Drawing.SizeF
scale
The scaling factor for the element. |
Pan(Int64, Int64)
Performs pan operations on the mini map with mode-specific handling for WholeWorld, StaticZoom, and OffsetZoom modes.
Declaration
public override void Pan(long x, long y)
Parameters
|
System.Int64
x
The horizontal pan offset in pixels. |
|
System.Int64
y
The vertical pan offset in pixels. |
Overrides
SetMapElement(RadMapElement)
Associates the mini map with a new main map element, managing event subscriptions for viewport synchronization.
Declaration
protected virtual void SetMapElement(RadMapElement mapElement)
Parameters
|
RadMapElement
mapElement
The RadMapElement to associate with this mini map. |
SetMiniMapMode(MiniMapMode)
Sets the mini map display mode, managing event subscriptions and triggering necessary layout and viewport updates.
Declaration
protected virtual void SetMiniMapMode(MiniMapMode mode)
Parameters
|
MiniMapMode
mode
The MiniMapMode to set for the mini map display behavior. |
SetZoomOffset(Int32)
Sets the zoom offset value and triggers viewport updates when the mini map is in OffsetZoom mode.
Declaration
protected virtual void SetZoomOffset(int value)
Parameters
|
System.Int32
value
The zoom offset value to set relative to the main map zoom level. |
Subscribe()
Subscribes to the main map viewport change events to maintain synchronization between the mini map and main map displays.
Declaration
protected virtual void Subscribe()
Unsubscribe()
Unsubscribes from the main map viewport change events to prevent memory leaks and unwanted synchronization during disposal.
Declaration
protected virtual void Unsubscribe()
Zoom(Int32, Boolean, Point)
Performs zoom operations on the mini map, with restrictions based on the current mini map mode settings.
Declaration
public override void Zoom(int zoomLevel, bool animate, Point center)
Parameters
|
System.Int32
zoomLevel
The target zoom level for the mini map. |
|
System.Boolean
animate
A value indicating whether to animate the zoom transition. |
|
System.Drawing.Point
center
The center point for the zoom operation. |