Navigation control


In this topic


About the Navigation control

The Navigation control is associated with a Map control and provides common map navigation functions, such as pan and zoom, in a single control. The visual representation of the control can be customized and rendered as an image, or character glyph in a true-type font. 

Using the control

  1. To add controls to the page, open or create a Web site in Visual Studio. Open a Web form in design mode, select the Toolbox panel, and expand the ArcGIS Web Controls tab. Drag and drop a MapResourceManager, Map, and Navigation control on the Web form. See the following screen shot that shows the page in Visual Studio:


  2. Add one or more resources to the MapResourceManager control. 
  3. Set up the Map control. 
  4. Select the Navigation control and do the following on the Properties page:
    1. Set the BuddyControl property to the name of the Map control created in Step 3. See the following screen shot:

       
    2. Use the DisplayCharacter property to define the font and character index of a glyph used for the Navigation control. To select another font or glyph, click the down arrow on the DisplayCharacter property value. Additional fonts and glyphs appear. See the following screen shot that shows the additional fonts and glyphs:


    3. To set the Navigation control to render as an image, set the DisplayImageUrl property to a valid uniform resource locator (URL). The image URL must be available from the perspective of the client browser at runtime and can be relative to the Web application.
  5. Change the position of the control to absolute, which enables the control to be placed anywhere on the page. By default, Visual Studio adds controls in flow layout. Right-click the Navigation control and select Style. The Style Builder dialog box appears. See the following screen shot:


  6. On the Style Builder dialog, click Position, click the Position mode drop-down arrow, then select Absolutely position.
  7. Click OK on the Style Builder dialog box.
  8. In design view, select the Navigation control and drag it to another location on the page. The Navigation control displays in the upper-left corner of the page, which is the default behavior associated with Web control positioning in Visual Studio. 
  9. Select the Navigation control again and drag it to the lower-right corner of the Map control.
  10. To navigate a Map at runtime using the Navigation control, move the mouse cursor over the Navigation control. Click and hold the left mouse button down in the direction on which you want the map to pan. For example, to pan to the west, position the cursor over the W on the map compass and hold the mouse button down. The map pans in the specified direction. While holding the mouse button down, move the mouse cursor around the Navigation control. The pan direction changes with respect to the cursor position on the control. See the following screen shots showing before and after panning to the west: 

Members

The following table shows a list of properties related to the Navigation control. For more reference information, see the Navigation control in the library reference section.
Property name
Type
Description
DisplayCharacter
DisplayCharacter
Character to display. If the DisplayImageUrl property is set, this property is ignored.
DisplayImageUrl
string
URL of the image to display. This property overrides the DisplayCharacter property.
ImageFormat
WebImageFormat
Format of the generated image when using a font character as a north arrow.
Map
string
Map control used to determine the rotation of the navigation width.
Size
int
Size of the north arrow in points (1/72 inch) when using a font character as a north arrow.
Speed
int
Speed that the map pans when navigating with the Navigation control.


See Also:

Web ADF controls
Customizing the Web Mapping application




To 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):
  • ESRI.ArcGIS.ADF.Web.UI.WebControls.dll