ESRI.ArcGIS.Mobile
Layer Class
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.Mobile Namespace : Layer Class

Defines the base class for layers in the map.

Object Model



Syntax

Visual Basic (Declaration) 
Public MustInherit Class Layer 
   Implements ILayer 
C# 
public abstract class Layer : ILayer  

Example

Assuming you have a MobileService called mobileService1, the following code example shows how to use mapLayer data to find position for raster layers in mapLayer collection.
C#Copy Code
// Generic List holding indexes of raster layers in the map  
List<int> RasterLayerIdx = new List<int>(); 
int iCnt = mobileService1.Layers.Count; 
for (int i = 0; i < iCnt; i++) 

  MobileServiceLayer layer = mobileService1.Layers[i]; 
  if (layer.GetType() == typeof(RasterLayer)) 
    RasterLayerIdx.Add(i); 

    
The following example shows how to check the layer type in the MobileServiceLayerCollection.
C#Copy Code
string info = ""; 
foreach (MobileServiceLayer cl in mobileService1.Layers) 

  if (cl.GetType() == typeof(FeatureLayer)) 
    info = info + "\n" + cl.Name + ": FeatureLayer"; 
  if (cl.GetType() == typeof(RasterLayer)) 
    info = info + "\n" + cl.Name + ": RasterLayer"; 
  if (cl.GetType() == typeof(AnnotationLayer)) 
    info = info + "\n" + cl.Name + ": AnnotationLayer"; 

MessageBox.Show(info); 
    

Remarks

As Layer is an abstract class for many other classes such as MobileServiceLayer, MobileCacheLayer, FeatureLayer, and so on. it provides basic properties/methods/events that are accessible from other classes. For more information, see MobileServiceLayer and MapLayer.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.Mobile.Layer
      ESRI.ArcGIS.Mobile.MobileServices.MobileCacheLayer

Requirements

Namespace: ESRI.ArcGIS.Mobile

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

Assembly: ESRI.ArcGIS.Mobile (in ESRI.ArcGIS.Mobile.dll)

See Also