


| Data Source Type | Dynamic Tiling Default |
|---|---|
| ArcGIS Server Local | Disabled |
| ArcGIS Server Internet | Disabled |
| ArcIMS | Enabled |
| ArcWeb | Disabled |
| OGC\WMS | Disabled |
| Graphics | Enabled |
| Microsoft Virtual Earth | Not applicable (no dynamic map services provided) |









<layer id>@<data frame name>@<service name>By default the layer id portion of the string is not included. You can insert a layer id in the resource definition string to define a single layer in the service you want to be accessible (e.g. drawn in the map).
{"type":"ImageServer","service":"<service name>","imageDescription":{"bandIds":"<band ids>",
"compressionQuality":<compression quality>}}The
JSON formatted string consists of three name-value pairs: type,
service, and imageDescription. The service name, band ids and
compression quality properties are updated via the Resource Definition
Editor dialog. In the dialog, you can add properties to the
imageDescription array of values to modify the dynamic map image
generated by the image service. Only compression, noData,
interpolation, and pixelType are supported. The properties reflect the
GeoImageDescription created to generate a new map image. For
example, define a NoData value equal to 89 to render
pixels with a data value of 89 as transparent. {"type":"ImageServer","service":"MyImageService","imageDescription":{"bandIds":"0",
"compressionQuality":0, "noData":89}} 







ResourceDefinition="layerSubset=3,6,12"To optimize performance only the first 10 layers in the service will be visible in the map. You can override the number of visible layers programatically on the WMS map resource.
protected void Page_Init(object sender, EventArgs e)
{
IMapResource mapResource = MapResourceManager1.GetResource("MapResourceItem0");
if (mapResource != null)
{
ESRI.ArcGIS.ADF.Web.DataSources.OGCWMSService.MapResource wmsMapResource =
mapResource as ESRI.ArcGIS.ADF.Web.DataSources.OGCWMSService.MapResource;
if (wmsMapResource != null)
{
wmsMapResource.MaxInitialSelectedLayers = 2;
wmsMapResource.DisplayErrorAsImage = true;
}
}
}
Graphics Layers






The Fields tab displays the fields in the selected layer. The check
box next to each field can be used to set the field visibility. You
can also edit the text in the Alias field if you do not want to use the
original field name.
The primary display field is often used to describe the contents of a
record. In general, it is set to a field that contains an
intuitive, preferrably unique value to identify an attribute. You can
select the primary display field using the drop down box next to "Primary
display field".
The default values in the Fields tab reflect the field aliases,
visibility and primary display field that you set in the configuration file (
e.g. map document -.mxd) for the map service. The values
entered in this dialog will only override these settings in the
current Web application. If you want the fields to appear the
same way in multiple Web applications, consider setting the field properties in
the map service configuration file instead of resetting them in each Web
application.

Results generated from querying the selected layer will contain only
visible fields and use field aliases to define column names. The
primary display field will be used to define the parent node text for
attributes displayed in a TaskResults
control.
For data sources that do not provide field settings, all fields are
visible by default and the alias is the same as the field name. The primary
display field is set to the first string field with "name" in it.
If no such field is found, the first string field is used. If there
are no string fields, the first numeric field is used.
Records
The Records tab displays the tabular format of results as displayed within the
browser at runtime. Record display properties for a specific layer can be
used to display results within a TaskResults control or in a
MapTips callout window. By default, visible fields are included in
the record display as name value pairs and the title is the primary
display field.

To customize the look and feel of record display, select the Custom Formatting
radio button. The Title and Contents sections of the dialog are now
editable. The Contents section provides a rich text editor to modify font
style and color or add fields, hyperlinks, tables or images. Edits
are stored as HTML style content to be rendered in the browser at runtime.

To view the HTML content that will be used to format layer results, select the
HTML radio button at the bottom of the dialog. The raw HTML content will
be displayed in the Content window. Any valid content to be rendered in a
browser can be added - this includes HTML, CSS definitions, and
JavaScript.

If a task, such as the SearchAttributesTask, uses the default layer format for
a queryable layer, the layer format defined with the layer's map resource item
will be used to render results at runtime. The following example
shows the results for a search on the Cities layer using the
SearchAttributesTask. The results are displayed in a TaskResults
control.
| Property Name | Type | Description |
|---|---|---|
| Initialized | bool | Indicates if the resource manager has been initialized during the current postback. |
| ResourceItems | GISResourceItemCollection <MapResourceItem> |
Returns a collection of MapResourceItems. Each MapResourceItem references a resource instance and display settings for the item. |
| 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. |
protected void MapResourceManager1_ResourceInit(object sender, EventArgs e)
{
ResourceInitEventArgs riea = (ResourceInitEventArgs)e;
if (riea.GISResourceItem.FailedToInitialize)
{
string message = riea.GISResourceItem.InitializationFailure.Message;
}
}
}
void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// set initial definition properties here
}
}
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.MapDescription;
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 Access a data source
specific API discussion.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.ServerObject;
IMapServerObjects2 mso = (IMapServerObjects2)ms;
IMap map = mso.get_Map(ms.DefaultMapName);
IFeatureLayer2 layer = (IFeatureLayer2)map.get_Layer(0);
IFeatureLayerDefinition2 definition = (IFeatureLayerDefinition2)layer;
definition.DefinitionExpression = "OBJECTID IN (3,5)";
mrl.RefreshServerObjects();
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.MapView;
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 = filter;