arcgis ui控件server web开发,控件MapResourceManager,data resouce这里填写什么,计算机名,IP等都报错,求解

本帖子已过去太久远了,不再提供回复功能。导读:实验一:基于.NET平台下ArcGISServer控件使用,实验目的:熟悉ArcGISServer控件的基本熟悉,实验步骤:,实验一:基于.NET平台下ArcGISServer控件使用实验目的:熟悉ArcGISServer控件的基本熟悉,以及属性的配置,掌握.NET平台的基本架构,熟悉.NET平台下的二次开发环境。实验步骤:(1)准备工作1、用ArcMap对已有的USA数据进行地图的制作,并保 实验一:基于.NET平台下ArcGIS Server控件使用 实验目的:熟悉ArcGIS Server控件的基本熟悉,以及属性的配置,掌握.NET平台的基本架构,熟悉.NET平台下的二次开发环境。 实验步骤: (1)准备工作 1、用ArcMap对已有的USA数据进行地图的制作,并保存为.MXD格式的地图文档; 2、用ArcGIS Server Manager或者ArcCatalog发布一个叫USA的Map Service,并且把这个Service启动起来。 (2)实施步骤 1、打开VS2010,新建一个空ASP.NET应用程序,然后添加一个名为Default的WEB窗体; 2、在Default.aspx页面的设计视窗下,添加一个表格进行页面设计,1个Map、1个Toolbar、1个MapResourceManager、3个FloatingPanel、1个OverviewMap、1个Toc、1个Navigation、一个Magnifier控件、以及一个ScaleBar控件,注意:OverviewMap、Toc、Navigation分别放置在3个FloatingPanel中; 3、对控件属性进行配置 ? MapResourceManager控件属性就行配置:选中MapResourcceManager 控件,点击Edit MapResourceManager,在弹出对话框中MapresourceItem集合编译器中添加一个MapResourceItem0的成员,点击右侧Information下Definition单元格,弹出地图资源编辑框(即将我们发布的地图服务,引入到开发环境中),设置如下: Type:ArcGIS Server Local Data
Source:win-rgf (服务器名称) Resource: Layer@USA ? Map控件:右键单击属性,打开属性面板,配置MapResourceManager的资源管理器,即MapResourceManager1; ? 设置OverviewMap1的Map属性为Map1,MapResourceManager属性为MapResourceManager1,OverviewMapResource属性为MapResourceItem0。 ? 设置Toc1的BuddyControl属性为Map1。 ? 设置Navigation1的的Map属性为Map1,可以通过设置DisplayCharacter属性改变显示的样子。 ? 设置Toolbar1,BuddyControlType属性为Map,ToolbarStyle属性为ImageOnly, BuddyControl属性为Map1,ToolbarItems属性:在弹出对话框中把Map Navigation下的MapZoomIn、MapZoomOut、MapPan、MapFullExtent都添加,不需要做其他设置。 ? Magnifier控件配置: MagnifierMapResource:MapResourceItem0 Map:Map1 MapResourceManager:MapResourceManager1 具体实现代码如下:
<form id=\ runat=\
<table border=\ style=\width: 790px\
<td colspan=\ style=\margin-left: 120px\
<esri:Toolbar ID=\ runat=\ BuddyControlType=\
Group=\ ToolbarItemDefaultStyle-BackColor=\
ToolbarItemDefaultStyle-Font-Names=\
ToolbarItemDefaultStyle-Font-Size=\
ToolbarItemDisabledStyle-BackColor=\
ToolbarItemDisabledStyle-Font-Names=\
ToolbarItemDisabledStyle-Font-Size=\
ToolbarItemDisabledStyle-ForeColor=\
ToolbarItemHoverStyle-BackColor=\ ToolbarItemHoverStyle-Font-Bold=\
ToolbarItemHoverStyle-Font-Italic=\
ToolbarItemHoverStyle-Font-Names=\
ToolbarItemHoverStyle-Font-Size=\
ToolbarItemSelectedStyle-BackColor=\
ToolbarItemSelectedStyle-Font-Bold=\
ToolbarItemSelectedStyle-Font-Names=\
ToolbarItemSelectedStyle-Font-Size=\ ToolbarStyle=\
WebResourceLocation=\ Width=\
<esri:Tool ClientAction=\ DefaultImage=\
HoverImage=\ JavaScriptFile=\ Name=\
SelectedImage=\
ServerActionAssembly=\
ServerActionClass=\
Text=\ ToolTip=\ />
<esri:Tool ClientAction=\ DefaultImage=\
HoverImage=\ JavaScriptFile=\ Name=\
SelectedImage=\
ServerActionAssembly=\
ServerActionClass=\
Text=\ ToolTip=\ />
<esri:Tool ClientAction=\ DefaultImage=\
HoverImage=\ JavaScriptFile=\ Name=\
SelectedImage=\
ServerActionAssembly=\
Height=\ ServerActionClass=\ Text=\
ToolTip=\ />
<esri:Command ClientAction=\ DefaultImage=\
HoverImage=\ Name=\
SelectedImage=\
ServerActionAssembly=\
ServerActionClass=\
Text=\ ToolTip=\ />
<esri:Magnifier ID=\ runat=\ BackColor=\
BorderColor=\ Font-Names=\
Font-Size=\ ForeColor=\ Height=\
MagnifierMapResource=\ Map=\
MapResourceManager=\ Title=\
TitleBarColor=\ TitleBarSeparatorLine=\
Transparency=\ Width=\
<esri:FloatingPanel ID=\ runat=\ BackColor=\
BorderColor=\ Font-Names=\
Font-Size=\ ForeColor=\ Height=\
style=\z-index: 1; left: 15 top: 122 position: height: 227 width: 200px\
Title=\ TitleBarColor=\ TitleBarHeight=\
TitleBarSeparatorLine=\ Width=\
Copyright Information
<td valign=\ class=\
<esri:Map ID=\ runat=\ Height=\ Width=\
MapResourceManager=\
<td valign=\ class=\
<esri:FloatingPanel ID=\ runat=\ BackColor=\ BorderColor=\
BorderStyle=\ BorderWidth=\ Font-Names=\ Font-Size=\ Transparency=\ Visible=\ BorderStyle=\ BorderWidth=\ TitleBarHeight=\ BorderStyle=\ BorderWidth=\ JavaScriptFile=\ ForeColor=\
Title=\鹰?眼?\ TitleBarColor=\ TitleBarHeight=\
TitleBarSeparatorLine=\ Transparency=\ Width=\
<esri:OverviewMap Width=\
Map=\ MapResourceManager=\
OverviewMapResource=\ />
<esri:FloatingPanel BorderColor=\
BorderStyle=\ BorderWidth=\ Font-Names=\ Font-Size=\ ForeColor=\
Title=\图?层?\ TitleBarColor=\ TitleBarHeight=\
TitleBarSeparatorLine=\ Transparency=\ Width=\
<esri:FloatingPanel BorderColor=\
BorderStyle=\ BorderWidth=\ Font-Names=\ Font-Size=\ ForeColor=\
Title=\导?航?\ TitleBarColor=\ TitleBarHeight=\ TitleBarSeparatorLine=\
Transparency=\ Width=\ Height=\
<esri:Navigation ID=\ runat=\ Map=\ Width=\
<esri:MapResourceManager ID=\ runat=\
<esri:MapResourceItem DataSourceDefinition=&win-rgf& ResourceDefinition=&Layers@USA& /&\
DisplaySettings=\100:dpi=96:color=:transbg=False:displayInToc=True:dynamicTiling=\
Definition=\DataSourceType=&ArcGIS Server ID=\ runat=\ BackColor=\ ID=\ runat=\ BackColor=\ ID=\ runat=\ Height=\ Local& Identity=&To set, right-click project and 'Add ArcGIS Identity'&
LayerDefinitions=\ Name=\ />
4、这样就完成了最简单的.NET平台下的ASP.NET应用程序
包含总结汇报、办公文档、资格考试、专业文献、文档下载、党团工作、教程攻略、应用文书、IT计算机以及实验报告等内容。本文共4页
相关内容搜索MapResourceManager control
MapResourceManager control
The MapResourceManager control&is often&the first control&you'll
add&to a Web application.&&The&design-time
interface&enables&you to add, remove and set properties for any
resource that provides mapped output, for example an&ArcIMS image
service&or an ArcGIS Server map service.&& Since the control is
designed to manage&multiple resources&at the same time,&it
provides properties to define how the resources interact, such as the order of
layers and transparency of map image output.&& Multiple controls can
use the same MapResourceManager to access the same&set of
resources.&& As a result, changes to a resource&can&be
reflected&in any control associated with the same
MapResourceManager.&
Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceManager
JavaScript libraries: display_common.js, display_dotnetadf.js
Using&the MapResourceManager control
Add the control 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
control on the Web form.& You should see the following in Visual
Studio.NET:&&
Note that&the MapResourceManager is only visible at design-time.&
Add&resources
To add map resources for use within your Web application, activate the control,
open or navigate to the&Properties window and click the ellipsis
(...)&next to the
ResourceItems
property.& A resource collection editor dialog should be displayed.
On the MapResourceItem Collection Editor dialog, click the Add button to add a
data source as a map resource to the MapResourceManager control.&& A
MapResourceItem&is added to the collection.& This item provides a
couple of properties to modify how the data source associated with this map
resource is displayed by other controls in the Web applications, such as a Map
The Name property is used to uniquely identify the resource within the
web application. This name will appear in the &(table
of contents)&as the name of the map service at the top of the Toc
hierarchy. It is highly recommended to set the resource name to a descriptive
value in your application. Often a good choice will be the name of the map
Under Appearance, the Display Settings
&property opens a&Map Resource Display Settings Editor, which
is&used to define the content of a map image generated by a data
source.&If a map image is created, transparent color and background work
together&define a color that will be rendered transparent in a
map&image.&
Blending &the resource&defines the visibility of a map image
relative to other map images in the same map resource collection.&&
When more than one map resource is visible, the map images generated by each
data source are blended together into a single image.& The map resource at
the&bottom of the the&one above it&is drawn
next&and so on.& Transparency values are defined for the
entire map image.&&A value of 0% means the map image will not be
transparent.& A value of 100% means the map image will be completely
transparent, thus not visible.& A value between 0% and 100% will render
the contents of a map image,&permitting the display of&the contents
in&map images below it.& If an image is partially transparent, it may
take longer to generate a&consolidated map image including all map
resources.&&
The Request MIME Data option determines how the map image will&be
requested from the data source.& If the data source supports sending a map
image via MIME format, the image will be stored in-memory&by the Web ADF
application.& If MIME data is not supported or selected, a data source
must generate an output image file and share the file location with the Web ADF
application.& Image format defines the&type of image generated by a
data source, for example, the format of the image&generated by ArcGIS
Server container process or the ArcIMS spatial server.&
Visible determines if&a map image is&generated.& If a
Toc is buddied to a Map control, the layer will be checked on in the Toc if
Visible is checked here.&If Visible is not checked, the layer will be
unchecked in the Toc.&
The Display in the Table of Contents&property&allows you to
hide&a resource in the&table of contents (Toc control).& The
resource can still be visible in the Map&or OverviewMap controls and
utilized by other controls, such as the SearchAttributesTask.
On&the MapResourceItem Collection
Editor dialog, the Definition property provides a set of dialogs to
connect to a data source provider (i.e. GIS Server) and create a map
resource.& Click the ellipsis (...) for the Definition property
to open the Resource Definition Editor.& Select the type of data source
and define the appropriate properties (see dialogs below).&& The
following data source types are available:
Server Local
Connecting to an
Server Local data source requires the machine name, or connection host, on
which the Server Object Manager is running.& The Additional GIS Servers
button enables configuring&fail-over/round-robin connections for the
resource.&&See the&section &for more details.&
Once the data source is defined, the Resource property opens the ArcGIS
Resource Definition Editor dialog which provides a list of available map
services and data frames.&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&
Note that the Identity property
is grayed out and cannot be set from&the Map Resource Definition
Editor&dialog.& At design-time, the identity of the user running
Visual Studio is used to connect to an ArcGIS Server local data source.&
At runtime, that identity is established by the Web application.& Only
one identity can be used to define access to all ArcGIS Server local data
sources in&a single&Web application.&&You can define this identity&by
right-clicking the Web project in Solution Explorer and selecting the Add ArcGIS Identity option.& Enter
the&identity credentials&which will be used to access ArcGIS Server
local resources at runtime.&&This information will be added to the
web.config file within a standard ASP.NET&identity tag.& If the
"Encrypt identity in web.config" checkbox is checked, the identity tag will be
otherwise, the username and password will be stored as clear
Server Internet
ArcGIS Server Web Services require
entering the partial&URL to the ArcGIS Manager collection of
services.&&This&URL includes the Web server host name, ArcGIS
instance, and "services" folder name.& This&general&URL will
provide a list of ArcGIS Server Web&Services to choose from.&If authentication is enabled for the&ArcGIS
Server Web service, you will need to provide a username and password.&
ArcGIS Server Web services are designed to support Basic, Digest, and
Integrated&authentication.& Basic and Digest authentication options
can be used to secure&ArcGIS Server Web services provided on the
Internet.&& All options can be used to secure&ArcGIS Server Web
services on a local area network.&&& Since&Basic and
Digest options&can be&insecure, confirm that the&Web site on
which ArcGIS Server Web services are available provides a secure channel for
communication - namely, that&it has enabled SSL encryption accessible via
HTTPS.& This&will sufficiently encrypt the transmission
of&identity credentials for&both authentication
options.&&&& Once the data source and identity (if necessary) are
entered, the Resource property opens the ArcGIS Resource Definition Editor
dialog which&provides a list of available&map services and data
frames.& The identity will determine which services are available.&
If no identity is specified, the remote Web server is responsible for
assigning an identity, often&an anonymous user account.&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&Ensure that ArcGIS Internet data
sources you use&are pooled GIS services. Pooled services are shared among
users of the Web application. Non-pooled service instances
(processes)&are dedicated to a single user, and the instance is destroyed
after the user finishes with it. If you use a non-pooled service in an
Internet connection, a new process will be created and destroyed with every
map or other GIS operation. This will lead to inefficient use of resources on
the GIS server, and will contribute no advantage to the application. If
necessary, contact the GIS server administrator to ensure that Internet
services used in the application are set to pooled status. For more
information on pooling of services, see
in ArcGIS Server Help.
ArcIMSTwo options are
available&for connecting to an ArcIMS data source:TCP :& If the Web ADF application has direct
network&access to the ArcIMS Application Server, you can create a TCP
connection.& Specify the hostname of the machine on which the ArcIMS
Application Server is running and the connection port (default 5300).&
TCP connections do not use authentication, therefore the Identity
credentials&are not&used.& HTTP:& If the Web ADF
application has access to a Web server that exposes the ArcIMS Servlet
Connector&you can use an HTTP connection.&&&Specify the
Web server hostname and the Web ADF will&discover if an appropriate
endpoint is&available. You can alternatively specify the full path to the
endpoint.& By default, the Servlet Connector&path&is
/servlet/com.esri.esrimap.Esrimap.&&The ArcXMLHandler does not have a default
location.&&If authentication has been enabled, enter the appropriate
information in the ArcIMS Identity Editor dialog.The Additional&IMS Servers button enables
configuring&fail-over/round-robin connections for the
resource.&&See&&for more details.&&Once the connection
properties have been set, use the Resource Definition Editor dialog to select
a map service.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ServicesArcWeb
Services provide dynamic map content via the Map Image Web service, and query
functionality via the Spatial Query Web service.&& The URL for the
Map Image Web service&is preset (not visible in the dialog)&and
cannot be changed.& The Map Image Web service URL is: .&
The URL for the Spatial
Query Web service is also preset in the dialog and cannot be changed.&
The Spatial Query Web service&URL is:&&.&
&A valid ArcWeb account (ESRI
Global user account) must be specified to connect to both&ArcWeb
services.&& Once connected, the Resource Definition Editor dialog
allows you to browse&any ArcWeb services that generate map images via the
Map drop-down list.& In addition, the Query drop-down list displays a
list of data layers (provided as ArcWeb services)&which can be used to
query both feature geometry and attribute
values.&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
OGC (WMS) ServiceThe Open
Geospatial&Consortium's Web Map Service&(WMS) specification
allows&for publishing of geographic data on&the Web in a common
way.&& Any Web endpoint that adheres to&WMS
specifications&can&be consumed as a data source by the Web
ADF.& Two common WMS endpoints are provided by ArcIMS and ArcGIS Server
Web services.& The OGC (WMS) Data Source Definition Editor dialog allows
you to define a&URL to&a WMS data source.&& One map data
source can be defined per URL.& The dialog&displays the contents of
the map data source upon successful connection.&&Select a&map
layer to display its metadata in the dialog.&&The common URL for an ArcIMS WMS
service is:http://&hostname&/wmsconnector/com.esri.wms.Esrimap/&servicename&The common&URL for an
ArcGIS Server WMS service is: http://&hostname&/arcgis/services/&servicename&/MapServer/WMSServerIdentity credentials are not
required to work with OGC WMS Services.& In addition, since there can be
only one resource per data source, a resource setting is not necessary.&&&&
Graphics LayersGraphics layers provide the ability to&draw geometry
and text&on a map without necessarily being associated with a data
source.&& By default, a Graphics layer&does not
have&content.& Geometry and text梐s well as their symbols,
renderers, and attributes梞ust be added programmatically.&
Specify buddy controls
Add other Web ADF controls to the Web form and buddy them with the
MapResourceManager.& In most cases, a Map control is buddied&with a
MapResourceManager by setting&the Map's&MapResourceManager
property.&& See the
for additional details.&&&
Properties
& The following table provides a list of&properties and
events&of interest.& For complete reference information, see the
MapResourceManager control in the library reference section.
Event Type&
Description
ResourceInit
Occurs when initializing a single resource.& More specifically, when the
Initialize method is called with a parameter.&&
ResourcesDispose
Occurs&when resources are disposed.& More specifically, when the
Dispose method is called, usually at the end of the ASP.NET page
lifecycle.& Occurs after the rendering phase in a full page postback
and&after GetCallbackResult in a callback.
ResourcesInit
Occurs&when all resources are initialized.& More specifically, when
the Initialize method is called without any parameters.&&&
Discussion&
Using&Layer Definitions
At times, it may be necessary to present only a subset of features in
a feature layer for display.&&Each map resource&can contain many
feature layers.& The Web ADF Common API does not provide a generic means
to filter and subset layer content.&& Rules for&applying a
definition to a layer&within a map resource&depend on&the data
source type.& Note,&a layer&definition will affect
the&display of features in the feature layer but will not restrict
queries.& To restrict queries,&either&change the properties of
the service&or modify the Web ADF application to check query
content&before they are initiated.&&
If a feature layer definition must be applied for the entire user session, set
the definition&during the Page Load or MapResourceManager Load
event.&&Each data source is discussed below - a MapResourceManager
named "MapResourceManager1" is assumed to be available in a Web page:
void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
// set initial definition properties here
ArcGIS Server
Both local and Internet data source types utilize the ArcGIS Server SOAP API,
thus both&can apply a&definition to a feature layer using the
LayerDescription.DefinitionExpression property.& The definition will be
maintained in&state by the Web ADF for the duration of the
session.&&The state of the server object will not be
changed.&&Use the following code as an example:&
[C#]if (!MapResourceManager1.Initialized)
MapResourceManager1.Initialize();
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase mrb = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase)
MapResourceManager1.GetResource(0);
ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdesc = mrb.MapD
ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription layerdesc = mapdesc.LayerDescriptions[0];
layerdesc.DefinitionExpression = "OBJECTID IN (3,5)";
When working with non-pooled map services, a stateful change to the server
object is recommended.& This will guarantee that a layer definition
will&successfully limit both the display and query&of layer
features.&&&An ArcGIS Server local data source is
required&to make a stateful change to a server object.& Use
the&following example as a guide.& For a more detailed discussion on
making&stateful changes to a map service,&see the ArcGIS
Server&section in the
discussion.
[C#]if (!MapResourceManager1.Initialized)
MapResourceManager1.Initialize();
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal mrl = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)
MapResourceManager1.GetResource(0);
IMapServer ms = (IMapServer)mrl.ServerContextInfo.ServerContext.ServerO
IMapServerObjects2 mso = (IMapServerObjects2)
IMap map = mso.get_Map(ms.DefaultMapName);
IFeatureLayer2 layer = (IFeatureLayer2)map.get_Layer(0);
IFeatureLayerDefinition2 definition = (IFeatureLayerDefinition2)
definition.DefinitionExpression = "OBJECTID IN (3,5)";
mrl.RefreshServerObjects();
The ArcIMS API provides the classes and properties necessary to apply a layer
definition&to a feature layer in an ArcIMS service.&&A Filter
object can store the definition expression and be associated with a layer via
the&FeatureLayer.Filter property.& The definition will be maintained
in&state by the Web ADF for the duration of the session.&Use the
following code as an example:
[C#]if (!MapResourceManager1.Initialized)
MapResourceManager1.Initialize();
ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapResource mr = (ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapResource)
MapResourceManager1.GetResource(0);
ESRI.ArcGIS.ADF.IMS.Carto.MapView mapview = mr.MapV
ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer featurelayer = (ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer)mapview.Layers[0];
ESRI.ArcGIS.ADF.IMS.Carto.Layer.Filter filter = new ESRI.ArcGIS.ADF.IMS.Carto.Layer.Filter("#ID# & 10");
featurelayer.Filter =
ArcWeb and OGC\WMS
Layer definitions&are not available.
Using multiple MapResourceManagers
If you are&adding multiple MapResourceManager controls to a single page,
set the map resource item names to be unique across all MapResourceManager
controls in the page. This will prevent any confusion at runtime between
resources with identical names.}

我要回帖

更多关于 arcgis activex控件 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信