博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年8月05日_周四_Navigation control

Posted on 2010-08-05 09:20  星尘的天空  阅读(381)  评论(0编辑  收藏  举报

/******************************************************************/

// Navigation control

//2010年8月5日 周四

/******************************************************************/


The navigation control is associated with a single map control.  It provides common map navigation functions, such as pan and zoom, in a single control.   In addition, the visual(视觉的、看得见的) representation(描写、表现) of the control can be customized.  It can be rendered as an image or character glyph within a true-type font. 
navigation 控件和一个单独的map控件相关联。 它提供基本的地图导航功能,比如:平移或者缩放,这些都在一个单独的控件里面实现。 另外,这个空间的外观是可以定制的。 她可以呈现为一幅图片或者字符库里面的字形。
Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.Navigation

Using the Navigation control

 

Add the controls to the page
Open or create a Web site within Visual Studio.NET.   Open a Web form in design mode, select the Toolbox, and expand the ArcGIS Web Controls tab.  Drag and drop a MapResourceManager, Map, and Navigation control on the Web form.  You should see the following in Visual Studio:
在VS.NET下,打开或者创建一个web站点,再设计模式下打开一个表单,选择toolbox,然后展开ArcGIS Web Controls 页签。向web 表格中拖拽一个MapResourceManager控件,地图控件,导航控件。

在VS里面你应该看到下面的情景。
  

Add one or more resources to the MapResourceManager.  See the Add Resources section in the MapResourceManager control topic for information on how to do this.
添加一个或者多个资源到MapResourceManager控件, 更多关于如何添加资源的方法请查看MapResourceManager 控件专题里面的Add Resource 部分。
Set up the Map control.  See the Set Map properties section in the Map control topic for additional information.

设置map 控件。更多信息,查看Map control专题里面的设置map属性的部分。

Set Navigation control properties
设置Navigation控件属性
Select the Navigation control.  In the Properties page:

Set the BuddyControl property to the name of the Map created in the previous step. 
选择Navigation控件,打开属性窗框。

设置Navigation控件的BuddyControl属性为:在上一步添加的地图控件的名称。

The DisplayCharacter property defines a font and the character index of a glyph to use for the Navigation control.  To select another font or glyph, click the down arrow in the property value.   The following dialog allows a visual search for other fonts and glyphs available.    
DisplayCharacter属性用来定义Navigation控件的字体风格以及字符的索引。为来选择两外一个字体或者glyph,单击属性值下面的向下箭头。下面的对话框允许在可视化的情况下搜索另外一个字体或者尅可以获得的glyphs。

To set the Navigation control to render as an image, set the DisplayImageUrl property to a valid URL.   The image URL must be available from the perspective of the client browser at runtime.  The URL can be relative to the Web application.

Change the position of the control
为来使Navigation控件看起来向一幅图片,设置DisplayImageUrl属性为一个可以得到的URL。图片的URL必须是运行状态下在客户端浏览器角度里面是一个可以获得的URL。 对应用个程序来说URL可是一个相当于值。

改变Navigation 控件的位置
Change the positioning of the control to be absolute, which enables the control to be placed anywhere on the page.  By default, Visual Studio 2005 adds controls in flow layout.  Right-click the Navigation control and select "Style".    In the Style Builder dialog, select the Position option and click the dropdown list under "Position Mode".  Select "Absolutely position" and click OK to exit the dialog.  Select the Navigation control in design view and start to drag it to another location on the page.  Note that it will immediately display in the upper left corner of the page.  This is default behavior associated with Web control positioning in Visual Studio 2005.  Select the Navigation control again and drag it into the lower right corner of the Map control.
将Navigation控件的位置设置为absolute,这样能够使控件放置到页面的任何位置。模型情况下,VS 2005是按照浮动的布局来添加控件的。在Navigation控件上面单击鼠标右键,选择”Style”。在样式设置对话框中,选择位置选项,单击Postion mode位置下面的下拉框列表控件,选择绝位置并且单击“OK”对出对话框。 在设计视图模式下选择Navigation控件并拖动它到页面的另外一个位置。注意:它将会立即跑到页面的左上角的位置。这是在VS里面wen adf 控件位置属性的默认的行为。 再一次选中Navigation控件,将它拖放到地图控件右下角的位置。
 

Navigate a Map at runtime using the Navigation control

在运行状态下使用导航控件对地图进行导航
At runtime, move the mouse cursor over the Navigation control.  Press and hold the left mouse button down on direction in which you would like the map to pan.  For example, to pan to the west, position the cursor over the "W" or the left side of the control and hold the mouse button down.  The map will pan in the direction indicated.  While holding the mouse button down, move the mouse cursor around the Navigation control.  Note that the pan direction will change with respect to cursor position on the control.

在运行状态下,将光标移动到Navigation控件的上方。 地图将会向指定的方向移动。当按下鼠标案件并在Navigation控件上面移动的时候,注意:地图平移的方向也将会改变,它代表着控件上光标的位置。

 


                                     
 

Members

Properties

  The following table provides a list of properties of interest.  For complete reference information, see the Navigation control in the library reference section.

Property Name

 Type

Description

DisplayCharacter

DisplayCharacter

The character to display. If the DisplayImageUrl property is set , then this property is ignored.

DisplayImageUrl

string

The 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

The Map Control used to determine the rotation of this Navigation with.

Size

int

Size of the north arrow in points (1/72 inch) when using a font character as a north arrow.

Speed

int

The speed that the map will pan when navigating with the Navigation Control