Provides access to the available properties of a map layer info object.
When To Use
Members
Name | Description | |
---|---|---|
CanFind | Indicates if the layer supports the Find operation. | |
CanIdentify | Indicates if the layer supports the Identify operation. | |
CanScaleSymbols | Indicates if the layer supports symbol scaling. | |
CanSelect | Indicates if the layer supports feature selection. | |
Description | The description of the layer. This property is set in the General tab of the Layer Properties dialog. | |
DisplayField | Primary display field. | |
Extent | The geographic extent of the layer. | |
FieldAliases | Array of strings that contains field alias for each field in Fields property. | |
Fields | Array of attribute fields contained in the layer. | |
HasAttributes | Indicates if the layer has attributes. | |
HasHyperlinks | Indicates if the layer has hyperlinks. | |
HasLabels | Indicates if the layer has labels to turn on and off. | |
ID | The layer identifier. This ID is used throughout to uniquely identify the layer for all requests. | |
IsComposite | Indicates if the layer is a composite layer. | |
IsFeatureLayer | Indicates if the layer is a feature layer. | |
MaxScale | The maximum visible scale for the layer. | |
MinScale | The minimum visible scale for the layer. | |
Name | The name of the layer. | |
ParentLayerID | If the layer is a member of a composite layer, this property identifies the parent layer. | |
SourceDescription | The description of the source information for the layer. | |
SubLayers | The list identifying the sublayers if the layer is a composite layer. | |
Type | The layer type. |
IMapLayerInfo.CanFind Property
Indicates if the layer supports the Find operation.
Public ReadOnly Property CanFind As Boolean
public bool CanFind {get;}
IMapLayerInfo.CanIdentify Property
Indicates if the layer supports the Identify operation.
Public ReadOnly Property CanIdentify As Boolean
public bool CanIdentify {get;}
IMapLayerInfo.CanScaleSymbols Property
Indicates if the layer supports symbol scaling.
Public ReadOnly Property CanScaleSymbols As Boolean
public bool CanScaleSymbols {get;}
IMapLayerInfo.CanSelect Property
Indicates if the layer supports feature selection.
Public ReadOnly Property CanSelect As Boolean
public bool CanSelect {get;}
IMapLayerInfo.Description Property
The description of the layer. This property is set in the General tab of the Layer Properties dialog.
Public ReadOnly Property Description As String
public string Description {get;}
IMapLayerInfo.DisplayField Property
Primary display field.
Public ReadOnly Property DisplayField As String
public string DisplayField {get;}
IMapLayerInfo.Extent Property
The geographic extent of the layer.
Public ReadOnly Property Extent As IEnvelope
public IEnvelope Extent {get;}
IMapLayerInfo.FieldAliases Property
Array of strings that contains field alias for each field in Fields property.
Public ReadOnly Property FieldAliases As IStringArray
public IStringArray FieldAliases {get;}
IMapLayerInfo.Fields Property
Array of attribute fields contained in the layer.
Public ReadOnly Property Fields As IFields
public IFields Fields {get;}
IMapLayerInfo.HasAttributes Property
Indicates if the layer has attributes.
Public ReadOnly Property HasAttributes As Boolean
public bool HasAttributes {get;}
IMapLayerInfo.HasHyperlinks Property
Indicates if the layer has hyperlinks.
Public ReadOnly Property HasHyperlinks As Boolean
public bool HasHyperlinks {get;}
IMapLayerInfo.HasLabels Property
Indicates if the layer has labels to turn on and off.
Public ReadOnly Property HasLabels As Boolean
public bool HasLabels {get;}
IMapLayerInfo.ID Property
The layer identifier. This ID is used throughout to uniquely identify the layer for all requests.
Public ReadOnly Property ID As Integer
public int ID {get;}
Remarks
ID is a unique identifier for a layer in a given instance of ArcGIS for Server map service. It is important to note that ID, SourceID and the index of layers (see MapLayerInfos) in map document are not the same. SourceID is used for map service interaction with the GPServer.
When a map service is published, a unique ID is assigned to all layers within the original map document (.mxd) starting from 0 (zero). This ID is accessible from IMapServerObjects2, MapLayerInfo, LayerDescription, MapServerLegendInfo, MapServerIdentifyResult, MapServerFindResult and FeatureExtent.
ID is not re-usable and does not change if the order of the layer is changed. This would change the how each layer is ordered in the index of layers. Adding new a layer results in a new ID being assigned. IDs keep incrementing as new layers are added to the map service. The limit of id numbers available is the limit of Long data type.
Please note that if the layer order in the TOC of the original map is changed or if layers are added/removed, the IDs will change accordingly.
IMapLayerInfo.IsComposite Property
Indicates if the layer is a composite layer.
Public ReadOnly Property IsComposite As Boolean
public bool IsComposite {get;}
IMapLayerInfo.IsFeatureLayer Property
Indicates if the layer is a feature layer.
Public ReadOnly Property IsFeatureLayer As Boolean
public bool IsFeatureLayer {get;}
IMapLayerInfo.MaxScale Property
The maximum visible scale for the layer.
Public ReadOnly Property MaxScale As Double
public double MaxScale {get;}
IMapLayerInfo.MinScale Property
The minimum visible scale for the layer.
Public ReadOnly Property MinScale As Double
public double MinScale {get;}
IMapLayerInfo.Name Property
The name of the layer.
Public ReadOnly Property Name As String
public string Name {get;}
IMapLayerInfo.ParentLayerID Property
If the layer is a member of a composite layer, this property identifies the parent layer.
Public ReadOnly Property ParentLayerID As Integer
public int ParentLayerID {get;}
IMapLayerInfo.SourceDescription Property
The description of the source information for the layer.
Public ReadOnly Property SourceDescription As String
public string SourceDescription {get;}
Remarks
_With ArcGIS Server 9.3 release, this property is deprecated and always returns empty string._
IMapLayerInfo.SubLayers Property
The list identifying the sublayers if the layer is a composite layer.
Public ReadOnly Property SubLayers As ILongArray
public ILongArray SubLayers {get;}
IMapLayerInfo.Type Property
The layer type.
Public ReadOnly Property Type As String
public string Type {get;}
Classes that implement IMapLayerInfo
Classes | Description |
---|---|
MapLayerInfo | The Map Layer Info coclass provides read-only information about a layer in a map. |
private IMapLayerInfo GetUNLayerInfo(IMapServer mapService)
{
IMapServerInfo mapServerInfo = mapService.GetServerInfo(mapService.DefaultMapName);
IMapLayerInfos layerInfos = mapServerInfo.MapLayerInfos;
for (int i = 0; i < layerInfos.Count; i++)
{
IMapLayerInfo layerInfo = layerInfos.Element[i];
if (layerInfo.Type.Equals("Utility Network Layer", StringComparison.OrdinalIgnoreCase))
{
return layerInfo;
}
}
return null;
}