Select to view content in your preferred language

WPF Control: Zoom with mouse wheel to center of map

1881
1
12-22-2010 06:47 AM
LukasPlatz
Emerging Contributor
Hi,

when zooming in/out with the mouse wheel, the WPF Map Control zooms always to the acual mouse position. How is it possible to zoom always to the center of the map using the mouse wheel?

Stefan
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
MouseWheel zoom with respect to current mouse position is by design. If you need to zoom to center, you may call MyMap.ZoomToResolution http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map~ZoomTo....
For example, the following code will zoom in around the center of the current extent.
MapPoint center = MyMap.Extent.GetCenter();
MyMap.ZoomToResolution(MyMap.Resolution/2, center );
0 Kudos