The MapPoint ActiveX Control provides you with a fully interactive map to perform actions such as panning, zooming and tracking mouse clicks and so on.

To pan a map you would use Map.Pan method. This method takes two arguments:
1. PanDirection: Indicates the direction of the pan operation; this property is of type MapPoint.GeoPanCmd enumeration. This enumeration contains values that represent directional values such as east, west, north, south, north-east and so on.
2. PanFactor: Indicates amount of pan. Even though there are no limits to the pan factor, you have to keep in mind that this value is dependent on the altitude of your map. To give you an idea of what I mean, at 1 mile (lower altitudes), a pan factor of 1 pans the map by 0.2 miles, but the same pan factor at 50 miles (a higher altitude) pans the map by 10 miles!

The following code shows how to call the Pan method:

axMappointControl1.ActiveMap.Pan(MapPoint.GeoPanCmd.geoWest, 1);

To learn more about this topic and other related topics, please buy Programming MapPoint in .NET

0 comments