MindFusion.Wpf Pack Programmer's Guide
Scrolling and Zooming

In order to enable scrolling and zooming, the MapView control must be placed inside a ScrollViewer.

The view can be panned interactively by dragging it with the mouse. The user can also zoom into or out of the map via the mouse wheel. To implement a different scroll or zoom interaction logic, you can use the properties and methods exposed by MapView from various input event handlers. In order to change the scroll position, call the ScrollTo method. In order to change the zoom level, set the ZoomFactor property or call the SetZoomFactor method.

The following excerpt from the Markers sample project shows how to center the view on a specific decoration object:

C#  Copy Code

mapView.ZoomFactor = 6;

// office is a reference to a DecorationBubble instance
mapView.ScrollTo(office.Latitude, office.Longitude);

// focus is necessary in order to receive mouse wheel events
mapView.Focus();

Visual Basic  Copy Code

mapView.ZoomFactor = 6

' office is a reference to a DecorationBubble instance
mapView.ScrollTo(office.Latitude, office.Longitude)

' focus is necessary in order to receive mouse wheel events
mapView.Focus()