public class

ArcGISLayerInfo

extends Object
implements Serializable
java.lang.Object
   ↳ com.esri.android.map.ags.ArcGISLayerInfo

Class Overview

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 ArcGISDynamicMapServiceLayer.

Summary

Public Constructors
ArcGISLayerInfo()
Instantiates an object of ArcGISLayerInfo.
ArcGISLayerInfo(String name, int id)
Instantiates an object of ArcGISLayerInfo.
ArcGISLayerInfo(String name, int id, ArcGISLayerInfo parent)
Instantiates an object of ArcGISLayerInfo.
Public Methods
static ArcGISLayerInfo fromJson(JsonParser parser)
Create a new instance.
int getId()
Returns the Id of the layer.
LayerServiceInfo getLayerServiceInfo()
ArcGISLayerInfo[] getLayers()
If the layer is a group layer, then this method returns the immediate sub-layers of the group layer;.
List<Legend> getLegend()
Gets the legend images and labels of the ArcGISLayerInfo.
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 isShowLegend()
Returns true if the legend of layer is shown.
boolean isVisible()
Returns true if the layer is set to visible; false otherwise.
void setLegend(List<Legend> legend)
Sets the legend images and labels of the ArcGISLayerInfo.
void setVisible(boolean visible)
Update the visibility of a layer.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ArcGISLayerInfo ()

Instantiates an object of ArcGISLayerInfo.

public ArcGISLayerInfo (String name, int id)

Instantiates an object of ArcGISLayerInfo.

Parameters
name String: the name of the layer
id int: the index of the layer.

public ArcGISLayerInfo (String name, int id, ArcGISLayerInfo parent)

Instantiates an object of ArcGISLayerInfo.

Parameters
name String: the name of the layer
id int: the index of the layer.
parent ArcGISLayerInfo: the parent

Public Methods

public static ArcGISLayerInfo fromJson (JsonParser parser)

Create a new instance.

Parameters
parser JsonParser: the parser
Returns
ArcGISLayerInfo ArcGISLayerInfo
Throws
Exception when parsing has an exception

public int getId ()

Returns the Id of the layer.

Returns
int the layer Id.

public LayerServiceInfo getLayerServiceInfo ()

public ArcGISLayerInfo[] getLayers ()

If the layer is a group layer, then this method returns the immediate sub-layers of the group layer;.

Returns
ArcGISLayerInfo[] the layers

public List<Legend> getLegend ()

Gets the legend images and labels of the ArcGISLayerInfo.

Returns
List<Legend> Returns the legend images and labels

public double getMaxScale ()

Gets the maxScale of the ArcGISLayerInfo.

Returns
double Returns the maxScale.

public double getMinScale ()

Gets the minScale of the ArcGISLayerInfo.

Returns
double Returns the minScale.

public String getName ()

Returns the name of the layer.

Returns
String the layer name.

public ArcGISLayerInfo getParentLayer ()

Gets the parent layer.

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

public boolean isShowLegend ()

Returns true if the legend of layer is shown.

Returns
boolean boolean

public boolean isVisible ()

Returns true if the layer is set to visible; false otherwise.

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

public void setLegend (List<Legend> legend)

Sets the legend images and labels of the ArcGISLayerInfo.

Parameters
legend List: the legend images and labels to set

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 boolean: the Boolean value for layer visibility.

public String toString ()

Returns
String