# 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](https://www.telerik.com/products/winforms/documentation/controls/map/features/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.

> caption Figure 1: Programmatic Pan and Zoom

![WinForms RadMap Programmatic Pan and Zoom](https://www.telerik.com/products/winforms/documentation/assets/490c4f85392a5a8d18fdebdde492f858/map-features-pan-and-zoom001.gif)

## Customizing Appearance

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

```VB.NET
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

* [Layers Overview](https://www.telerik.com/products/winforms/documentation/controls/map/features/layers/overview)
* [Mini Map](https://www.telerik.com/products/winforms/documentation/controls/map/features/minimap)
* [Navigation Controls](https://www.telerik.com/products/winforms/documentation/controls/map/features/navigation-controls)
* [Scale Indicators](https://www.telerik.com/products/winforms/documentation/controls/map/features/scale-indicators)
* [Legend](https://www.telerik.com/products/winforms/documentation/controls/map/features/legend)
