com.esri.android.map.ags
Class ArcGISLayerInfo

java.lang.Object
  extended by com.esri.android.map.ags.ArcGISLayerInfo
All Implemented Interfaces:
Serializable

public class ArcGISLayerInfo
extends Object
implements Serializable

While working with the ArcGISDynamicMapServiceLayer and ArcGISTiledMapServiceLayer class, it is possible for you to access the individual layers contained within the dynamic map service through the getLayers() method. These individual layer objects are represented using this ArcGISLayerInfo class.

The ArcGISLayerInfo class specifies the properties for a given layer that is retrieved from the map service. For each layer, you can retrieve a layer's id, name, and check to see if the layer is visible or not.

In addition, you can get a list of sub-layers if the layer actually represents a group layer and set its visibility. You should never need to instantiate an object of this class and will only receive instances by calling the getLayers() method of the ArcGISDynamicMapServieLayer.

See Also:
Serialized Form

Constructor Summary
ArcGISLayerInfo(String name, int id)
          Instantiates an object of ArcGISLayerInfo.
ArcGISLayerInfo(String name, int id, ArcGISLayerInfo parent)
          Instantiates an object of ArcGISLayerInfo.
 
Method Summary
 int getId()
          Returns the Id of the layer.
 ArcGISLayerInfo[] getLayers()
          If the layer is a group layer, then this method returns the immediate sub-layers of the group layer;
 double getMaxScale()
          Gets the maxScale of the ArcGISLayerInfo.
 double getMinScale()
          Gets the minScale of the ArcGISLayerInfo.
 String getName()
          Returns the name of the layer.
 ArcGISLayerInfo getParentLayer()
          Gets the parent layer.
 boolean isVisible()
          Returns true if the layer is set to visible; false otherwise.
 void setVisible(boolean visible)
          Update the visibility of a layer.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArcGISLayerInfo

public ArcGISLayerInfo(String name,
                       int id)
Instantiates an object of ArcGISLayerInfo.

Parameters:
name - the name of the layer
id - the index of the layer.

ArcGISLayerInfo

public ArcGISLayerInfo(String name,
                       int id,
                       ArcGISLayerInfo parent)
Instantiates an object of ArcGISLayerInfo.

Parameters:
name - the name of the layer
id - the index of the layer.
Method Detail

getLayers

public ArcGISLayerInfo[] getLayers()
If the layer is a group layer, then this method returns the immediate sub-layers of the group layer;


isVisible

public boolean isVisible()
Returns true if the layer is set to visible; false otherwise.

Returns:
true when the layer is visible; false otherwise.

setVisible

public void setVisible(boolean visible)
Update the visibility of a layer. If true is passed in, then the layer will become visible. If false is passed in, then the layer will invisible.

Parameters:
visible - the Boolean value for layer visibility.

getName

public String getName()
Returns the name of the layer.

Returns:
the layer name.

getId

public int getId()
Returns the Id of the layer.

Returns:
the layer Id.

getParentLayer

public ArcGISLayerInfo getParentLayer()
Gets the parent layer.

Returns:
Returns the parent layer or null if the layer is a root layer.

getMinScale

public double getMinScale()
Gets the minScale of the ArcGISLayerInfo.

Returns:
Returns the minScale.

getMaxScale

public double getMaxScale()
Gets the maxScale of the ArcGISLayerInfo.

Returns:
Returns the maxScale.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.