public class

GroupLayer

extends Layer
java.lang.Object
   ↳ com.esri.android.map.Layer
     ↳ com.esri.android.map.GroupLayer
Known Direct Subclasses

Class Overview

A group layer is a collection of layers extending from the Layer class. it can appear and act as a single layer and has a Layer object's properties such as visibility, extent etc.

If the group layer is the map's first layer, the map will be initialized by the first layer of group layer.

Summary

[Expand]
Inherited Fields
From class com.esri.android.map.Layer
Public Constructors
GroupLayer()
Creates a GroupLayer.
GroupLayer(boolean initLayer)
The Constructor.
Public Methods
boolean addLayer(Layer layer, int index)
Inserts a layer object at certain position in the group layer.
int addLayer(Layer layer)
Adds a layer to the current layer group by appending it to the bottom.
void addLayers(Layer[] layers)
Adds an array of layers to the current layer group.
int count()
Returns the size of the group layer.
long getAddGraphicsLayerRequestCallbackHandle()
This method is used internally only.
SpatialReference getDefaultSpatialReference()
Gets the defaultSpatialReference of the Layer.
Envelope getFullExtent()
Returns the full extent of the layer.
Layer getLayer(int index)
Returns the layer for the given index position.
Layer getLayerByID(long layerId)
Returns the Layer object matching the given ID.
Layer[] getLayers(String layername)
Returns all layers for the given layer name.
Layer[] getLayers()
Returns the direct sublayers in an array.
boolean hasLayer(int index)
Tests if the group contains the sublayer in the given index.
boolean hasLayer(String layername)
Tests if the group contains the sublayer with given name.
boolean isInitialized()
The initialization of a GroupLayer is depended upon if it is empty (return false ) or its first layer being initialized.
void recycle()
Releases resources referenced by the Layer so that they can be recycled.
void removeAll()
The sublayers are removed and destroyed from the group layers.
void removeLayer(int index)
Removes the layer in the given index.
void removeLayers(String layerName)
Remove all layers by for the given name.
void setOpacity(float opacity)
Sets the opacity of the GroupLayer, it will change all opacity of it sublayers.
Protected Methods
long create()
void finalize()
void graphicsLayerAddRequest(String layerName, int index)
Callback when a GraphicLayer is added to the GroupLayer in the MessageProcessor.
void initLayer()
Initializes the layer.
void setDefaultSpatialReference(SpatialReference defaultSpatialReference)
Sets the defaultSpatialReference of the Layer.
[Expand]
Inherited Methods
From class com.esri.android.map.Layer
From class java.lang.Object

Public Constructors

public GroupLayer ()

Creates a GroupLayer.

public GroupLayer (boolean initLayer)

The Constructor.

Parameters
initLayer boolean: the init layer

Public Methods

public boolean addLayer (Layer layer, int index)

Inserts a layer object at certain position in the group layer.

Parameters
layer Layer: a Layer object to be added.
index int: an integer of position.
Returns
boolean true if the layer is inserted successfully.

public int addLayer (Layer layer)

Adds a layer to the current layer group by appending it to the bottom.

Parameters
layer Layer: the layer
Returns
int the index of the new added layer. return -1 if the layer fail to add the group layer.

public void addLayers (Layer[] layers)

Adds an array of layers to the current layer group.

Parameters
layers Layer: an array of layers

public int count ()

Returns the size of the group layer.

Returns
int the size of the group layer.

public long getAddGraphicsLayerRequestCallbackHandle ()

This method is used internally only. The end user will not use it directly.

Returns
long a long number.

public SpatialReference getDefaultSpatialReference ()

Gets the defaultSpatialReference of the Layer.

Returns
SpatialReference Returns the defaultSpatialReference.

public Envelope getFullExtent ()

Returns the full extent of the layer. Returns NULL if the group layer is empty.

Returns
Envelope an Envelope object

public Layer getLayer (int index)

Returns the layer for the given index position.

Parameters
index int: an integer for layer position.
Returns
Layer a Layer object

public Layer getLayerByID (long layerId)

Returns the Layer object matching the given ID.

Parameters
layerId long: a long integer.
Returns
Layer a Layer object.

public Layer[] getLayers (String layername)

Returns all layers for the given layer name.

Parameters
layername String: a layer name string
Returns
Layer[] a Layer object

public Layer[] getLayers ()

Returns the direct sublayers in an array.

Returns
Layer[] an array of Layer objects

public boolean hasLayer (int index)

Tests if the group contains the sublayer in the given index.

Parameters
index int: a layer index.
Returns
boolean true if the layer exists in the given index.

public boolean hasLayer (String layername)

Tests if the group contains the sublayer with given name.

Parameters
layername String: a layer name string.
Returns
boolean true if the layer exists with the given name.

public boolean isInitialized ()

The initialization of a GroupLayer is depended upon if it is empty (return false ) or its first layer being initialized.

Returns
boolean boolean

public void recycle ()

Releases resources referenced by the Layer so that they can be recycled.

public void removeAll ()

The sublayers are removed and destroyed from the group layers.

public void removeLayer (int index)

Removes the layer in the given index.

Parameters
index int: an integer should be less than current group layer size.

public void removeLayers (String layerName)

Remove all layers by for the given name.

Parameters
layerName String: a layer name.

public void setOpacity (float opacity)

Sets the opacity of the GroupLayer, it will change all opacity of it sublayers.

Parameters
opacity float: the opacity to set.

Protected Methods

protected long create ()

Returns
long

protected void finalize ()

Throws
Throwable

protected void graphicsLayerAddRequest (String layerName, int index)

Callback when a GraphicLayer is added to the GroupLayer in the MessageProcessor.

Parameters
layerName String: String
index int: integer
Throws
Exception

protected void initLayer ()

Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.

protected void setDefaultSpatialReference (SpatialReference defaultSpatialReference)

Sets the defaultSpatialReference of the Layer.

Parameters
defaultSpatialReference SpatialReference: The defaultSpatialReference to set.