New to Telerik UI for WinForms? Start a free 30-day trial

Handles mouse, keyboard, and gesture input for a map viewport, including panning, zooming, and overlay selection.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

C#
public class MapInputBehavior : IDisposable

Inheritance: objectMapInputBehavior

Derived Classes: MiniMapInputBehavior

Implements: IDisposable

Constructors

Initializes a new input behavior and creates its mouse-wheel, hover, and tooltip helpers.

C#
public MapInputBehavior()

Properties

Gets the MapElement this behavior is associated with.

C#
public BaseMapElement MapElement { get; }

Gets the maximum amount of zoom levels that can be changed at once when using the mouse wheel.

C#
public int MaxZoomDelta { get; set; }

Gets or sets the number of pixels the map is moved when using the keyboard keys to pan.

C#
public int PanDelta { get; set; }

Methods

Releases the timers and tooltip owned by this input behavior.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Releases managed input resources before the owning map is disposed.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

Whether managed resources should be released.

Creates the timers and tooltip used by the default input handlers.

C#
protected virtual void Initialize()

Zooms in or out at the double-click location, or zooms to a cluster's bounds on a left double-click.

C#
public virtual void OnDoubleClick(EventArgs e)
Parameters:eEventArgs

The mouse event data for the double-click.

Provides an override hook for generic gesture input; the default implementation does nothing.

C#
public virtual void OnGesture(GestureEventArgs args)
Parameters:argsGestureEventArgs

The gesture event data.

Pans with the arrow keys and changes zoom by one level with the plus and minus keys.

C#
public virtual void OnKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

The key event data.

Provides an override hook for key-press input; the default implementation does nothing.

C#
public virtual void OnKeyPress(KeyPressEventArgs e)
Parameters:eKeyPressEventArgs

The key-press event data.

Provides an override hook for key-release input; the default implementation does nothing.

C#
public virtual void OnKeyUp(KeyEventArgs e)
Parameters:eKeyEventArgs

The key event data.

Captures the pointer and records the starting location used for dragging and click detection.

C#
public virtual void OnMouseDown(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse event data.

Focuses the map when the pointer enters, except when the map is a minimap or its search box has focus.

C#
public virtual void OnMouseEnter(EventArgs e)
Parameters:eEventArgs

The event data.

Provides an override hook for mouse-hover notifications; the default implementation does nothing.

C#
public virtual void OnMouseHover(EventArgs e)
Parameters:eEventArgs

The event data.

Cancels pending hover work and hides the tooltip when the pointer leaves.

C#
public virtual void OnMouseLeave(EventArgs e)
Parameters:eEventArgs

The event data.

Pans while the left button is held, or hit-tests overlays and schedules tooltips while the pointer is idle.

C#
public virtual void OnMouseMove(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse event data.

Selects the hit overlay after a left-button click within the system drag rectangle; holding Control preserves the existing selection, and pointer capture is then released.

C#
public virtual void OnMouseUp(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse event data.

Accumulates mouse-wheel movement and applies the combined zoom change after a short delay, capped by MaxZoomDelta.

C#
public virtual void OnMouseWheel(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse-wheel event data.

Applies the pan gesture's pixel offset to the map viewport.

C#
public virtual void OnPanGesture(PanGestureEventArgs args)
Parameters:argsPanGestureEventArgs

The pan gesture data.

Provides an override hook for press-and-tap gestures; the default implementation does nothing.

C#
public virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
Parameters:argsPressAndTapGestureEventArgs

The gesture event data.

Provides an override hook for rotation gestures; the default implementation does nothing.

C#
public virtual void OnRotateGesture(RotateGestureEventArgs args)
Parameters:argsRotateGestureEventArgs

The rotation gesture data.

Provides an override hook for two-finger taps; the default implementation does nothing.

C#
public virtual void OnTwoFingerTapGesture(GestureEventArgs args)
Parameters:argsGestureEventArgs

The gesture event data.

Changes zoom by one level according to the gesture's zoom factor, centered on the gesture location.

C#
public virtual void OnZoomGesture(ZoomGestureEventArgs args)
Parameters:argsZoomGestureEventArgs

The zoom gesture data.

Selects an overlay and optionally preserves the map's existing selection.

C#
public virtual void SelectElement(MapVisualElement element, bool extendSelection)
Parameters:elementMapVisualElement

The overlay to select.

extendSelectionbool

true to add the overlay to the current selection; otherwise, clear the previous selection first.