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

2010年8月06日_周五_PageLayout control

Posted on 2010-08-06 10:04  星尘的天空  阅读(557)  评论(0编辑  收藏  举报

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

// PageLayout control

//2010年8月6日 周五

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



The PageLayout control is designed to display the layout from a map document served through ArcGIS Server. A layout is typically created in a map document for printing or displaying a map and related items. The user may print the layout page displayed in the browser.
PageLayout控件是用来展示通过ArcGIS服务器的提供的地图文档的的布局。 布局是为了打印地图文档而特别创建的或者是为来展示地图以及和地图相关的项。 用户可能打印浏览器里面的页面布局。


A toolbar may be included on the page, and tools added at design time. These tools allow the user to interact with the layout. Standard tools may be added that allow zooming and panning the layout page, as well as zooming and panning the map.
页面可能包含一个工具条而且里面的工具是在设计的时候添加进来的。因此这些工具允许用户和布局之间进行交互。标准工具可能被添加进来,用他们可以实现布局页面的平移或者缩放,或者打印地图。


Unlike the Map control, the PageLayout control does not use an associated MapResourceManager. Instead, the resource information is set in the properties of the PageLayout control itself. 
和Map地图控件不同,PageLayout 控件不需要一个MapResourceManager与之相关联,它的资源信息由PageLayout控件自己的属性进行设置。
Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.PageLayout

 

Using the PageLayout 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 PageLayout control and, optionally, a Toolbar control onto the Web form.  You should see the following in Visual Studio:
使用PageLayout控件

向page里面添加控件

在VS.NET下打开或者创佳一个web站点。 在设计模式下打开一个表单,选择工具箱展开ArcGIS Web 控件页签。拖拽一个PageLayout  控件,一个工具条控件到web 表单。在VS里面如下所示:

If you added a Toolbar control, set its BuddyControlType property to PageLayout, and add the PageLayout control you just added to the BuddyControls collection. Then add one or more tools to the toolbar. When the buddy control is a page layout, the tools include tools to zoom and pan on the page, as well as tools to zoom and pan on the map. See the Toolbar control page for details on setting these properties.

Set PageLayout properties
如果你添加了一个工具条控件,设置BuddyControlType属性到PageLayout控件, 然后将你刚刚添加的PageLayout控件添加到buddyControls集合中。 然后向工具条中添加一个或者多个工具项。如果绑定的控件是一个pagelayout控件,应该包含页面和地图的缩放和平移工具。查看Toolbar 控件页面获取更多个如何设置这些属性的详细信息。
Select the PageLayout control.  In the Properties page:

Click in the value of the PageLayoutResource property, then click the ellipsis (...) button. This opens the Page Layout Resource Definition Editor. 

In the resource definition editor, set the Type to ArcGIS Server Local. Set the Data Source by clicking the ellipsis (...) button to the right of the property line, or type the name of the ArcGIS Server machine.

选择PageLayout控件,打开其属性窗口:

单击PageLayoutResource属性,然后单击其后面的省略号,打开Page Layout Resource编辑对话框:

在资源定义对话框中,设置Type为:ArcGIS Server Lcal(本地的ArcGIS Server服务),单击 Data Source属性栏后面的省略号对Data Source 属性进行设置,或者输入ArcGIS Server服务器的名称。

Set the Resource used to an available service. Click the ellipsis (...) button to display a dialog where you can select a resource from a drop-down list. Click OK to accept the choices and dismiss(不在考虑,解雇) the dialog boxes. 
设置Resource属性为一个可以获得的服务, 单击省略号按钮弹出一个对话框,在这个对话框里面你可以从一个下拉框里里面选择一个资源。单击[OK]按钮接受上面的选择并关闭当前的对话框

Resize the PageLayout control to an acceptable size. Click to select it on the page, then left-click and hold over a handle on a side or a corner of the control and drag the control to an acceptable size. By default, the position of controls added in Visual Studio 2005 at design time is not set. As a result, the controls are permitted to flow from left to right within a line, and from top to bottom within the page. See the section about control positioning in the Visual Studio Integration topic for more information.

Add an ArcGIS Identity
重新设置PageLayout控件到一个合适的大小。在页面上单击并选中它,然后移动鼠标到控件的一个边缘的把柄或者控件的某一个角落,然后拖动控件到一个合适的大小。 默认情况下,在设计的时候,在VS里面添加的控件的位置是没有设置的。结果,控件允许从左到右在一条线上浮动,从上到下浮动在页面中。 更多关于控件位置设置信息请查看Visual Studio Integration

添加一个ArcGIS 的身份证明
Web sites using an ArcGIS Server Local resource must contain an ArcGIS identity to enable use of the resource. To add an identity, right-click on the Web application in the Solution Explorer, and click Add ArcGIS Identity. A dialog displays where you can enter the user name, password, and domain or machine name. Click OK to insert the identity, which is stored in the web.config file of the application.
使用一个ArcGIS Seever 本地资源的web 站点需要包含一个ArcGIS的身份验证才能使用ArcGISServer地图服务。 为了添加一个身份验证。在解决方案管理器里面右键单击web应用程序,然后选择“Add ArcGIS Identity”.在这个对话框里面你可以输入用户名称,用户密码,域名或则服务器的名称。单击OK插入这个身份验证,这些信息保存在应用程序里面的web.config文件里面
The identity must be a member of the agsusers group on the server object manager (SOM) machine. Only one identity is allowed per application, so if your application connects to multiple local servers, make sure that the identity account is in the agsusers group on all of the servers.
这个身份必须是SOM机器上agsusers组中的一个成员。每一个应用程序中只允许添加一个应用程序,如果你的应用程序于多个本地服务器之间连接,那么就要保证你添加的这个身份是所有的服务器上的agsusers组里面的一个成员。
If an appropriate(恰当的,适当的) identity is not added to the application, the user will see an error at runtime.

Members
如果一个适当的身份吗没有被添加到应用程序里面,那么在运行程序的时候用户就会看到一个错误的信息。
Properties
The following table provides a list of properties and events of interest.  For complete reference information, see the PageLayout control in the library reference section.

Property Name

 Type

Description

ClientToolGraphicsColor

Color

The color of the box drawn on the Map/PageLayout control display while using the DragRectangle or PageDragRectangle Client Action tools (while zooming in/out, for example).

ClientToolGraphicsWidth

int

Line width of shapes dragged on the Map/PageLayout controls while using a Tool.

EnableContinuousCallback

bool

Whether images will be fetched(拿来) continuously during panning of the map or only when panning is complete.

ImageFormat

WebImageFormat

Format of output image.

InitialExtent

InitialExtent

The initial extent(范围、程度) at which a control first renders.

PageLayoutResource

GISResourceItemDefinition

MapResource to display in PageLayout.

ToolItems

PageToolItemCollection

Collection of tool items.

UseMimeData

bool

Set true to store output images in session and stream them to the client or to store them on the file system instead.

VirtualDirectory

string

The path to the virtual directory in which images can be written, for example, ~/output/.

 

Events

Event Type 

Description

BeginCreateWebPageLayout

Raised before a WebPageLayout is created.

BeginDisposeWebPageLayout

Raised before a WebPageLayout is disposed.

BeginRefreshWebPageLayout

Raised before a WebPageLayout is refreshed.

ContentsChanged

Raised when the contents of this control (e.g. the extent) are changed.

DragImage

Raised when the control processes a tool associated with the DragImage Client Tool Action.

DragRectangle

Raised when the control processes a tool associated with the DragRectangle Client Tool Action.

EndCreateWebPageLayout

Raised after a WebPageLayout is created.

EndDisposeWebPageLayout

Raised after a WebPageLayout is disposed.

EndRefreshWebPageLayout

Raised after a WebPageLayout is refreshed.

MapDragImage

Raised when the control processes a tool associated with the MapDragImage Client Tool Action.

MapDragRectangle

Raised when the control processes a tool associated with the MapDragRectangle Client Tool Action.

MapPoint

Raised when the control processes a tool associated with the MapPoint Client Tool Action.

PageClick

Raised when the PageLayout control has been clicked.

Point

Raised when the control processes a tool associated with the Point Client Tool Action.

ScaleChanged