ClassMiniMapElement
Represents a mini map element that provides an overview of the main map with viewport control, zoom management, and interactive navigation capabilities.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadMap.dll
Syntax:
public class MiniMapElement : BaseMapElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IMapViewport
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementBaseMapElementMiniMapElement
Implements:
Inherited Members
Constructors
MiniMapElement()
Initializes a new instance of the MiniMapElement class with default input behavior for interactive mini map navigation.
Declaration
public MiniMapElement()
Fields
ViewportControlBackColorProperty
Identifies the ViewportControlBackColor dependency property that defines the background color of the viewport control rectangle.
Declaration
public static RadProperty ViewportControlBackColorProperty
Field Value
ViewportControlBorderColorProperty
Identifies the ViewportControlBorderColor dependency property that defines the border color of the viewport control rectangle.
Declaration
public static RadProperty ViewportControlBorderColorProperty
Field Value
Properties
IsAnimating
Gets a value indicating whether a collapse or expand animation is currently active, preventing user interactions during the transition.
IsCollapsed
Gets or sets a value indicating whether the mini map is currently collapsed to show only the toggle button.
MapElement
Gets the main map element that this mini map is associated with for synchronization and viewport management.
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
MiniMapSize
Gets or sets the size of the mini map display area, automatically scaled for DPI settings with layout invalidation support.
ToggleMiniMapButton
Gets the toggle button element that allows users to expand or collapse the mini map display.
Declaration
public MiniMapToggleButtonElement ToggleMiniMapButton { get; }
Property Value
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
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
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
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.
Methods
ArrangeOverride(SizeF)
Arranges the mini map child elements within the specified final size, positioning the toggle button in the top-right corner.
BringIntoView(PointG)
Brings the specified geographic location into view by centering the mini map viewport on that location.
CalculateViewport(SizeF)
Calculates the viewport dimensions and geographic bounds based on the current mini map mode and final size.
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
A configured MiniMapToggleButtonElement for mini map visibility control.
DrawViewportControlRectangle(IGraphics, float, 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
graphics
The IGraphics object used for drawing the viewport rectangle.
angle
The rotation angle for the element.
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.
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
sender
The source of the event.
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
sender
The source of the event.
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
sender
The source of the event.
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
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
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
sender
The source of the event.
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
sender
The source of the event.
args
A StateChangingEventArgs containing the state change information.
PaintDynamicMiniMap(IGraphics, float, SizeF)
Paints the mini map in OffsetZoom mode with clipping and viewport control rectangle overlay.
PaintElement(IGraphics)
Overrides the base paint element method to prevent default painting behavior in favor of mode-specific rendering.
PaintElement(IGraphics, float, 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
graphics
The IGraphics object used for rendering the mini map.
angle
The rotation angle for the element.
scale
The scaling factor for the element.
Overrides
PaintProvidersContent(IGraphics)
Paints the content from map providers, with caching support during animations for improved performance.
PaintStaticMiniMap(IGraphics, float, SizeF)
Paints the mini map in StaticZoom mode with clipping and viewport control rectangle overlay.
PaintWholeWorldMiniMap(IGraphics, float, 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
graphics
The IGraphics object used for rendering the mini map.
angle
The rotation angle for the element.
scale
The scaling factor for the element.
Pan(long, long)
Performs pan operations on the mini map with mode-specific handling for WholeWorld, StaticZoom, and OffsetZoom modes.
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
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
mode
The MiniMapMode to set for the mini map display behavior.
SetZoomOffset(int)
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
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(int, bool, Point)
Performs zoom operations on the mini map, with restrictions based on the current mini map mode settings.