MapLayerInfo
Base Type: MapTableInfo
A class that provides read-only information about layers in a map.
Property |
Type |
Description |
---|---|---|
CanFind |
bool |
Determines if the Find method can be used on this layer. |
CanIdentify |
bool |
Determines if the Identify method can be used on this layer. |
CanModifyDrawingDescription | bool | Indicate whether DrawingDescription can be modified |
CanScaleSymbols |
bool |
If a reference scale has been set in the map document and the layer supports symbol scaling the value for CanScaleSymbols will be true. If no reference scale has been set in the map document the value will be false. If a reference scale has been set in the map and you want layer symbology to scale, use ScaleSymbols on a LayerDescription. |
CanSelect |
bool |
Determines if the layer supports rendering selected features. |
CopyrightText |
string |
Text information on the layer content ownership and rights. |
DefaultSubtypeCode |
int |
The default subtype when a new feature is added. |
Description |
string |
The text information on the contents of a layer. |
DisplayField |
string |
The primary attribute field which can be used for display purposes. |
EndTimeFieldName |
string |
The name of the field that stores the end time of data with irregular time intervals. |
Extent |
The full extent of the layer. To get the map units use Units available from MapServerInfo. | |
FieldAliases |
string[] |
An array of field aliases. |
Fields |
An array of Field objects, one for each attribute field in the layer. | |
FullTimeExtent |
The TimeExtent of interest for which the layer was authored. | |
HasAttachments |
bool |
Indicates if the layer has attachments. |
HasAttributes |
bool |
Determines if the layer has attributes. |
HasHyperlinks |
bool |
Determines if the layer has hyperlinks. |
HasLabels |
bool |
Determines if the layer has a label renderer. |
HasLayerDrawingDescription |
bool | Indicates if the layter has LayerDrawingDescription or not. |
HasLiveData | bool | Indicates whether the layer is being updated frequently with new data. |
HasSubtype |
bool |
Indicates if the layer has subtypes. |
HTMLPopupType |
The popup type. | |
IDField |
string |
If a sub-layer (layer within a composite layer) this references the parent layer's ID. |
IsComposite |
bool |
Determines if the layer is a composite layer. Composite layers are layers composed of other layers. |
IsFeatureLayer |
bool |
Determines if the layer is a feature layer. |
LayerID |
int |
The unique layer identifier. |
LayerType |
string |
Descriptive layer type. |
MaxScale |
double |
The maximum visible scale for the layer. |
MinScale |
double |
The minimum visible scale for the layer. |
Name |
string |
The name of a layer. It may not be unique. |
ParentLayerID |
int |
If a sub-layer (layer within a composite layer) this references the parent layer's ID. |
RelateInfos |
If the table is related to one or more layer(s)/table(s) in the map document, this property returns information about those relates. | |
SourceDescription |
string |
Always returns an empty string. Included for backward compatibility. |
StartTimeFieldName |
string |
Indicates the field name in the table that contains the time at which the feature/object begins to exist. |
SubtypeFieldName |
string |
The name of the field that stores subtype codes which are used to group features within the layer. |
SubtypeInfos |
Array of SubtypeInfo objects. | |
SubLayerIDs |
int[] |
If a parent layer (a composite layer) this references the child layer ids. |
SupportsAdvancedQueries | bool | Indicates if the table supports calculating advanced queries (i.e. ORDER BY clauses) on its fields. |
SupportsStatistics | bool | Indicates if the table supports calculating statistics on its fields. |
SupportsTime |
bool |
Is the layer Time aware. True, if the layer participate in the time of the display. |
TimeInterval |
double |
Time interval defines the granularity of the time data. |
TimeIntervalUnits |
Time unit for DrawTimeInterval. | |
TimeReference |
Indicates which time zone and daylight savings time values were used when the underlying data was recorded. | |
TimeValueFormat |
string |
Indicates to the layer how time value is stored in the data. |
TrackIDFieldName |
string |
The field name that identifies the track ids for the layer. |
Remarks
LayerID is a unique identifier for a layer in a given instance of ArcGIS Server map service. It is important to note that LayerID, SourceID and the index of layers in map document are not the same. LayerDescription's SourceID is used for map service interaction with a geoprocessing service. When a map service is published, a unique ID is assigned to all layers within the original map starting from 0. This ID is accessible from MapLayerInfo, LayerDescription, MapServerLegendInfo, MapServerIdentifyResult, MapServerFindResult and FeatureExtent. Layers cannot be reordered or added dynamically via SOAP. As a result, the LayerID property cannot be changed by client actions.
Composite layers may also be nested. Composite (parent) layers and their members (sublayers or child layers) are numbered according to their TOC order. Composite layers cannot be queried. If you attempt to query a composite layer you will receive an error message stating that an input parameter is incorrect. Composite layers can be identified. You can use a parent layer ID by itself to Identify features from all member sublayers. However, you cannot use the parent layer ID by itself in order to query sublayers using the GetLegendInfo, Find or QueryHyperlinks methods on MapServer. You need to include the sublayers IDs in the input array.
MapLayerInfo includes two elements providing information on composite layers. These include a list identifying the sublayers if the layer is a composite layer (SubLayerIDs) and an integer identifying the parent layer if this layer is a member of a composite layer (ParentLayerID).
Time
TimeInterval defines the granularity of the time data. It is used for defining the number of times you want to query the data, may be, from a slider. And the date time extent can be used to set the beginning and end of the time you want to restrict your query; this information could be used to set the minimum and maximum value of the slider. FullTimeExtent can provide information on the beginning and end of the times available.
Subtypes and Domains
When SubtypeFieldName is null, the layer does not have any subtypes defined. In case the subtype field is not visible in the source map document, MapServer does not return any subtype information. When a subtype does not have a domain for a given field, the SubtypeInfo.FieldDomainInfos will not have that information for that field.
A subtype can have default value. This is usually needed for editing. For example, a local street could have the default value for a speed limit attribute set to 25 miles per hour, while the default value for the main streets subtype could be 35 miles per hour. Whenever a local street is added to the streets feature class, its speed limit attribute will automatically be set to 25 miles per hour. Whenever a main street is added, the speed limit will automatically be set to the default of 35 miles per hour.
CanModifyDrawingDescription
Indicates whether MapServer allows the client to change the renderer for the layer dynamically without restarting a mapservice. MapServer currently supports only FeatureLayer for changing its renderer dynamically.
When Symbol Level Drawing is enabled on a group layer, then none of the sub layers in the group layer's renderer is allowed to be modified. But if Symbol Level Drawing is set on a feature layer, then dynamic rendering is enabled on the layer.
Please note that when MapServerInfo::SupportsDynamicLayers is False, this property for a layer will return False regardless of layer type or above rules.
Examples
C#
//get the service
wsmap.mapservice1_MapServer mapservice = new wsmap.mapservice1_MapServer();
mapservice.Url = "http://srver/ArcGIS/services/mapservice1/MapServer";
//get the server info
string mapname = mapservice.GetDefaultMapName();
MapServerInfo mapinfo = mapservice.GetServerInfo(mapname);
//get the layer infos
MapLayerInfo[] maplayerinfos = mapinfo.MapLayerInfos;
foreach (MapLayerInfo info in maplayerinfos)
{
System.Diagnostics.Debug.WriteLine(info.LayerID);
}