com.esri.arcgis.carto
Interface IMapLayers

All Superinterfaces:
Serializable
All Known Subinterfaces:
IMapLayers2
All Known Implementing Classes:
Map, Scene

public interface IMapLayers
extends Serializable

Provides access to layers.

Remarks

IMapLayers provides access to a collection of properties and methods dealing with layers in a map. This includes special methods including those dealing with group layers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void addLayer(ILayer layer)
          Adds a layer to the map.
 void addLayers(IEnumLayer layers, boolean autoArrange)
          Adds multiple layers to the map, arranging them nicely if specified.
 void clearLayers()
          Removes all layers from the map.
 void deleteLayer(ILayer layer)
          Deletes a layer from the map.
 ILayer getLayer(int index)
          The layer at the given index.
 int getLayerCount()
          Number of layers in the map.
 IEnumLayer getLayers(IUID uid, boolean recursive)
          The layers in the map of the type specified in the uid.
 void insertLayer(ILayer pLayer, boolean autoArrange, int position)
          Inserts a layer at the given position.
 void insertLayerInGroup(IGroupLayer pGroup, ILayer pLayer, boolean autoArrange, int position)
          Inserts a layer at a given index of the map's group layer.
 void insertLayers(IEnumLayer pLayers, boolean autoArrange, int position)
          Inserts layers at the given position.
 void insertLayersInGroup(IGroupLayer pGroup, IEnumLayer pLayer, boolean autoArrange, int position)
          Inserts layers at a given index of the map's group layer.
 boolean isLayerVisible(ILayer layer)
          Check if layer is visible.
 void moveLayer(ILayer layer, int toIndex)
          Moves a layer to another position.
 void moveLayerEx(IGroupLayer pFromGroup, IGroupLayer pToGroup, ILayer pLayer, int newPosition)
          Moves the layer with in the map.
 

Method Detail

getLayerCount

int getLayerCount()
                  throws IOException,
                         AutomationException
Number of layers in the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayer

ILayer getLayer(int index)
                throws IOException,
                       AutomationException
The layer at the given index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayers

IEnumLayer getLayers(IUID uid,
                     boolean recursive)
                     throws IOException,
                            AutomationException
The layers in the map of the type specified in the uid. If recursive is true it will return layers in group layers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
uid - A reference to a com.esri.arcgis.system.IUID (in, optional, pass 0 if not required)
recursive - The recursive (in, optional, pass true if not required)
Returns:
A reference to a com.esri.arcgis.carto.IEnumLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLayer

void addLayer(ILayer layer)
              throws IOException,
                     AutomationException
Adds a layer to the map.

Remarks

Adds the layer to the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLayers

void addLayers(IEnumLayer layers,
               boolean autoArrange)
               throws IOException,
                      AutomationException
Adds multiple layers to the map, arranging them nicely if specified.

Description

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the layers are added in the proper position as by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.

Remarks

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the sequence of layers is by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
layers - A reference to a com.esri.arcgis.carto.IEnumLayer (in)
autoArrange - The autoArrange (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteLayer

void deleteLayer(ILayer layer)
                 throws IOException,
                        AutomationException
Deletes a layer from the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

moveLayer

void moveLayer(ILayer layer,
               int toIndex)
               throws IOException,
                      AutomationException
Moves a layer to another position.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
toIndex - The toIndex (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearLayers

void clearLayers()
                 throws IOException,
                        AutomationException
Removes all layers from the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isLayerVisible

boolean isLayerVisible(ILayer layer)
                       throws IOException,
                              AutomationException
Check if layer is visible.

Remarks

This method determines if a layer is actually visible in a map. It does this by checking to see if the layer is not drawn due to scale ranges and also by validating whether or not the layer is in a composite layer or group layer that is not visible.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Returns:
The isLayerVisible
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertLayer

void insertLayer(ILayer pLayer,
                 boolean autoArrange,
                 int position)
                 throws IOException,
                        AutomationException
Inserts a layer at the given position.

Remarks

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the layer is added in the proper position as by its weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers. If autoArrange is true for this method, the position passed in is ignored as the position is determined by the auto arrange logic.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
autoArrange - The autoArrange (in)
position - The position (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertLayers

void insertLayers(IEnumLayer pLayers,
                  boolean autoArrange,
                  int position)
                  throws IOException,
                         AutomationException
Inserts layers at the given position.

Remarks

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the layers are added in the proper position as by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers. If autoArrange is true for this method, the position passed in is ignored as the position is determined by the auto arrange logic.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pLayers - A reference to a com.esri.arcgis.carto.IEnumLayer (in)
autoArrange - The autoArrange (in)
position - The position (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertLayerInGroup

void insertLayerInGroup(IGroupLayer pGroup,
                        ILayer pLayer,
                        boolean autoArrange,
                        int position)
                        throws IOException,
                               AutomationException
Inserts a layer at a given index of the map's group layer.

Remarks

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the sequence of layers is by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pGroup - A reference to a com.esri.arcgis.carto.IGroupLayer (in)
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
autoArrange - The autoArrange (in)
position - The position (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertLayersInGroup

void insertLayersInGroup(IGroupLayer pGroup,
                         IEnumLayer pLayer,
                         boolean autoArrange,
                         int position)
                         throws IOException,
                                AutomationException
Inserts layers at a given index of the map's group layer.

Remarks

The autoArrange parameter controls the ordering of the layers. If autoArrange is set to TRUE, the sequence of layers is by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pGroup - A reference to a com.esri.arcgis.carto.IGroupLayer (in)
pLayer - A reference to a com.esri.arcgis.carto.IEnumLayer (in)
autoArrange - The autoArrange (in)
position - The position (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

moveLayerEx

void moveLayerEx(IGroupLayer pFromGroup,
                 IGroupLayer pToGroup,
                 ILayer pLayer,
                 int newPosition)
                 throws IOException,
                        AutomationException
Moves the layer with in the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pFromGroup - A reference to a com.esri.arcgis.carto.IGroupLayer (in)
pToGroup - A reference to a com.esri.arcgis.carto.IGroupLayer (in)
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
newPosition - The newPosition (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.