Roam command
To successfully use the ControlsMapRoamTool on a ToolbarControl buddied to a MapControl or PageLayoutControl, the command requires the IDynamicMap.DynamicMapEnabled property to be set to true. Failure to set the IDynamicMap.DynamicMapEnabled property to true results in the command being disabled.
When the ControlsMapRoamTool is set as the current tool, the end user can seamlessly pan the display of the MapControl or PageLayoutControl in any direction by moving the tool in the direction they want to pan.
The following code example assumes a MapControl, ToolbarControl, and LicenseControl have been embedded into a form:
[C#] private void Form1_Load(object sender, System.EventArgs e)
{
IDynamicMap dynamicMap=AxMapControl1.Map as IDynamicMap;
dynamicMap.DynamicMapEnabled=true;
}
[VB.NET] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dynamicMap As IDynamicMap
dynamicMap=AxMapControl1.Map
dynamicMap.DynamicMapEnabled=True
End Sub
When using the roam tool, the map display can pause while caching the data to be displayed.
See Also:
ControlsMapRoamToolTo use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
ArcGIS for Desktop Basic | |
ArcGIS for Desktop Standard | |
ArcGIS for Desktop Advanced |