MapInputBehavior
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:
public class MapInputBehavior : IDisposable
Inheritance: objectMapInputBehavior
Derived Classes:
Implements:
Constructors
Initializes a new input behavior and creates its mouse-wheel, hover, and tooltip helpers.
public MapInputBehavior()
Properties
Gets the MapElement this behavior is associated with.
public BaseMapElement MapElement { get; }
Gets the maximum amount of zoom levels that can be changed at once when using the mouse wheel.
public int MaxZoomDelta { get; set; }
Methods
Releases the timers and tooltip owned by this input behavior.
public void Dispose()
Implements:
Releases managed input resources before the owning map is disposed.
protected virtual void Dispose(bool disposing)
Whether managed resources should be released.
Creates the timers and tooltip used by the default input handlers.
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.
public virtual void OnDoubleClick(EventArgs e)
The mouse event data for the double-click.
Provides an override hook for generic gesture input; the default implementation does nothing.
public virtual void OnGesture(GestureEventArgs args)
The gesture event data.
Pans with the arrow keys and changes zoom by one level with the plus and minus keys.
Provides an override hook for key-press input; the default implementation does nothing.
public virtual void OnKeyPress(KeyPressEventArgs e)
The key-press event data.
Provides an override hook for key-release input; the default implementation does nothing.
Captures the pointer and records the starting location used for dragging and click detection.
public virtual void OnMouseDown(MouseEventArgs e)
The mouse event data.
Focuses the map when the pointer enters, except when the map is a minimap or its search box has focus.
Provides an override hook for mouse-hover notifications; the default implementation does nothing.
Cancels pending hover work and hides the tooltip when the pointer leaves.
Pans while the left button is held, or hit-tests overlays and schedules tooltips while the pointer is idle.
public virtual void OnMouseMove(MouseEventArgs e)
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.
Accumulates mouse-wheel movement and applies the combined zoom change after a short delay, capped by MaxZoomDelta.
public virtual void OnMouseWheel(MouseEventArgs e)
The mouse-wheel event data.
Applies the pan gesture's pixel offset to the map viewport.
public virtual void OnPanGesture(PanGestureEventArgs args)
The pan gesture data.
Provides an override hook for press-and-tap gestures; the default implementation does nothing.
public virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
The gesture event data.
Provides an override hook for rotation gestures; the default implementation does nothing.
public virtual void OnRotateGesture(RotateGestureEventArgs args)
The rotation gesture data.
Provides an override hook for two-finger taps; the default implementation does nothing.
public virtual void OnTwoFingerTapGesture(GestureEventArgs args)
The gesture event data.
Changes zoom by one level according to the gesture's zoom factor, centered on the gesture location.
public virtual void OnZoomGesture(ZoomGestureEventArgs args)
The zoom gesture data.
Selects an overlay and optionally preserves the map's existing selection.
public virtual void SelectElement(MapVisualElement element, bool extendSelection)
The overlay to select.
extendSelectionbooltrue to add the overlay to the current selection; otherwise, clear the previous selection first.