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

Pan and Zoom

RadMap can be panned and zoomed both from the UI as well as programmatically.

UI Pan and Zoom

The end user can pan the control by simply holding the left mouse button and dragging the map to a desired location. The zoom operation can be performed with a double click on the map or by using the mouse scroll wheel. The same behavior can also be achieved with the navigation controls.

Programmatic Pan and Zoom

The control exposes an API for panning and zooming programmatically. The responsible Pan and Zoom methods have several overloads handling different scenarios.

Figure 1: Programmatic Pan and Zoom

WinForms RadMap Programmatic Pan and Zoom

Customizing Appearance

this.radMap1.Zoom(8, true);
this.radMap1.Pan(new SizeL(200, 200));

Me.RadMap1.Zoom(8, True)
Me.RadMap1.Pan(New SizeL(200, 200))

ViewportChanged Event

To get notified when the users pan or zoom the RadMap control, you can subscribe to the ViewportChanged event of the control. When the map is Panned, this event will be called one time with ViewportChangeAction set to Pan. However, when the map is Zoomed, first the map will be zoomed then it will be panned. This behavior will trigger the ViewportChanged event twice. The first time the ViewportChangeAction will be set to ViewportChangeAction.Zoom, the second time this property will be set to ViewportChangeAction.All.

See Also

In this article