com.esri.android.map
Class GroupLayer

java.lang.Object
  extended by com.esri.android.map.Layer
      extended by com.esri.android.map.GroupLayer

public class GroupLayer
extends Layer

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.

Since:
1.1

Field Summary
 
Fields inherited from class com.esri.android.map.Layer
credentials, nativeHandle, popUpInfos, serviceInfo
 
Constructor Summary
GroupLayer()
          Creates a GroupLayer.
 
Method Summary
 int addLayer(Layer layer)
          Adds a layer to the current layer group by appending it to the bottom.
 boolean addLayer(Layer layer, int index)
          Inserts a layer object at certain position in the group layer.
 void addLayers(Layer[] layers)
          Adds an array of layers to the current layer group.
 int count()
          Returns the size of the group layer.
protected  long create()
           
protected  void finalize()
           
 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()
          Returns the direct sublayers in an array.
 Layer[] getLayers(String layername)
          Returns all layers for the given layer name.
protected  void graphicsLayerAddRequest(String layerName, int index)
          Callback when a GraphicLayer is added to the GroupLayer in the MessageProcessor.
 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.
protected  void initLayer()
          Initializes the layer.
 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.
protected  void setDefaultSpatialReference(SpatialReference defaultSpatialReference)
          Sets the defaultSpatialReference of the Layer.
 void setOpacity(float opacity)
          Sets the opacity of the GroupLayer, it will change all opacity of it sublayers.
 
Methods inherited from class com.esri.android.map.Layer
changeStatus, getCredentials, getDpi, getExtent, getHeight, getID, getInitialExtent, getName, getOpacity, getParent, getPoolExecutor, getPopupInfo, getQueryUrl, getResolution, getServiceExecutor, getSpatialReference, getTitle, getUrl, getUrlHashCode, getWidth, isRecycled, isShowLegend, isVisible, isWebMapBaselayer, loadServiceInfo, lock, reinitializeLayer, setCredentials, setFullExtent, setInitialExtent, setName, setOnStatusChangedListener, setPopupInfos, setQueryUrls, setUrl, setVisible, unlock, updateSpatialReferenceStatus, verifyCredentials
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupLayer

public GroupLayer()
Creates a GroupLayer.

Since:
1.1
Method Detail

create

protected long create()
Specified by:
create in class Layer

initLayer

protected void initLayer()
Description copied from class: Layer
Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.

Specified by:
initLayer in class Layer

isInitialized

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

Overrides:
isInitialized in class Layer
Returns:
boolean
Since:
1.1

getLayers

public Layer[] getLayers()
Returns the direct sublayers in an array.

Returns:
an array of Layer objects
Since:
1.1

getLayers

public Layer[] getLayers(String layername)
Returns all layers for the given layer name.

Parameters:
layername - a layer name string
Returns:
a Layer object
Since:
1.1

getLayerByID

public Layer getLayerByID(long layerId)
Returns the Layer object matching the given ID.

Parameters:
layerId - a long integer.
Returns:
a Layer object.
Since:
1.1

getLayer

public Layer getLayer(int index)
Returns the layer for the given index position.

Parameters:
index - an integer for layer position.
Returns:
a Layer object
Since:
1.1

addLayer

public int addLayer(Layer layer)
Adds a layer to the current layer group by appending it to the bottom.

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

addLayer

public boolean addLayer(Layer layer,
                        int index)
Inserts a layer object at certain position in the group layer.

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

addLayers

public void addLayers(Layer[] layers)
Adds an array of layers to the current layer group.

Parameters:
layers - an array of layers
Since:
1.1

removeAll

public void removeAll()
The sublayers are removed and destroyed from the group layers.

Since:
1.1

hasLayer

public boolean hasLayer(String layername)
Tests if the group contains the sublayer with given name.

Parameters:
layername - a layer name string.
Returns:
true if the layer exists with the given name.
Since:
1.1

hasLayer

public boolean hasLayer(int index)
Tests if the group contains the sublayer in the given index.

Parameters:
index - a layer index.
Returns:
true if the layer exists in the given index.
Since:
1.1

removeLayer

public void removeLayer(int index)
Removes the layer in the given index.

Parameters:
index - an integer should be less than current group layer size.
Since:
1.1

removeLayers

public void removeLayers(String layerName)
Remove all layers by for the given name.

Parameters:
layerName - a layer name.
Since:
1.1

count

public int count()
Returns the size of the group layer.

Returns:
the size of the group layer.
Since:
1.1

getFullExtent

public Envelope getFullExtent()
Returns the full extent of the layer. Returns NULL if the group layer is empty.

Overrides:
getFullExtent in class Layer
Returns:
an Envelope object
Since:
1.1

setDefaultSpatialReference

protected void setDefaultSpatialReference(SpatialReference defaultSpatialReference)
Sets the defaultSpatialReference of the Layer.

Overrides:
setDefaultSpatialReference in class Layer
Parameters:
defaultSpatialReference - The defaultSpatialReference to set.

getDefaultSpatialReference

public SpatialReference getDefaultSpatialReference()
Gets the defaultSpatialReference of the Layer.

Overrides:
getDefaultSpatialReference in class Layer
Returns:
Returns the defaultSpatialReference.
Since:
1.1

recycle

public void recycle()
Description copied from class: Layer
Releases resources referenced by the Layer so that they can be recycled.

Overrides:
recycle in class Layer

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Layer
Throws:
Throwable

setOpacity

public void setOpacity(float opacity)
Sets the opacity of the GroupLayer, it will change all opacity of it sublayers.

Overrides:
setOpacity in class Layer
Parameters:
opacity - the opacity to set.
Since:
1.1

getAddGraphicsLayerRequestCallbackHandle

public long getAddGraphicsLayerRequestCallbackHandle()
This method is used internally only. The end user will not use it directly.

Returns:
a long number.
Since:
1.1

graphicsLayerAddRequest

protected void graphicsLayerAddRequest(String layerName,
                                       int index)
                                throws Exception
Callback when a GraphicLayer is added to the GroupLayer in the MessageProcessor.

Parameters:
layerName - String
index - integer
Throws:
Exception


Copyright © 2010. All Rights Reserved.