com.vividsolutions.wms
Class MapLayer

java.lang.Object
  extended by com.vividsolutions.wms.MapLayer

public class MapLayer
extends java.lang.Object

Represents a WMS Layer.

Author:
Chris Hodgson chodgson@refractions.net

Constructor Summary
MapLayer(java.lang.String name, java.lang.String title, java.util.Collection srsList, java.util.Collection subLayers, BoundingBox bbox)
          Creates a new instance of MapLayer
 
Method Summary
 BoundingBox getBoundingBox()
          Gets the LatLonBoundingBox for this layer.
 java.util.Collection getFullSRSList()
           
 java.util.ArrayList getLayerList()
          Returns a list of all the layers in order of a root-left-right traversal of the layer tree.
 java.lang.String getName()
          Gets the name of this Layer.
 MapLayer getParent()
          Gets the parent MapLayer of this MapLayer.
 java.util.ArrayList getSRSList()
          Returns a copy of the list of supported SRS's.
 MapLayer getSubLayer(int n)
          Returns the sub-layer at the specified index.
 java.util.ArrayList getSubLayerList()
          Gets a copy of the list of the sublayers of this layer.
 java.lang.String getTitle()
          Gets the title of this MapLayer.
 int numSubLayers()
          Returns the number of sub-layers that this MapLayer has.
 java.lang.String toString()
          Returns a somewhat nicely-formatted string representing all of the details of this layer and its sub-layers (recursively).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapLayer

public MapLayer(java.lang.String name,
                java.lang.String title,
                java.util.Collection srsList,
                java.util.Collection subLayers,
                BoundingBox bbox)
Creates a new instance of MapLayer

Method Detail

numSubLayers

public int numSubLayers()
Returns the number of sub-layers that this MapLayer has.

Returns:
the number of sub-layers that this MapLayer has

getSubLayer

public MapLayer getSubLayer(int n)
Returns the sub-layer at the specified index.

Parameters:
n - the index of the sub-layer to return
Returns:
the MapLayer sub-layer at the specified index

getSubLayerList

public java.util.ArrayList getSubLayerList()
Gets a copy of the list of the sublayers of this layer.

Returns:
a copy of the Arraylist containing all the sub-layers of this layer

getLayerList

public java.util.ArrayList getLayerList()
Returns a list of all the layers in order of a root-left-right traversal of the layer tree.

Returns:
a list of all the layers in order of a root-left-right traversal of the layer tree.

getTitle

public java.lang.String getTitle()
Gets the title of this MapLayer. The title of a layer should be used for display purposes.

Returns:
the title of this Layer

getName

public java.lang.String getName()
Gets the name of this Layer. The name of a layer is its 'back-end', ugly name, which generally shouldn't need to be used by others but is available anyway. Layers which do not have any data associated with them, such as container or grouping layers, might not have a name, in which case null will be returned.

Returns:
the name of the layer, or null if it doesn't have a name

getParent

public MapLayer getParent()
Gets the parent MapLayer of this MapLayer.

Returns:
the parent layer of this MapLayer, or null if the layer has no parent.

getBoundingBox

public BoundingBox getBoundingBox()
Gets the LatLonBoundingBox for this layer. If this layer doesn't have a LatLonBoundingBox specified, we recursively ask the parent layer for its bounding box. The WMS spec says that each layer should either have its own LatLonBoundingBox, or inherit one from its parent, so this recursive call should be successful. If not, null is returned. However, if a bounding box is returned, it will have the SRS string "LatLon". Note that the BoundingBox is not necessarily "tight".

Returns:
the BoundingBox for this layer, or null if the BBox is unknown

getSRSList

public java.util.ArrayList getSRSList()
Returns a copy of the list of supported SRS's. Each SRS is a string in the format described by the WMS specification, such as "EPSG:1234".

Returns:
a copy of the list of supported SRS's

getFullSRSList

public java.util.Collection getFullSRSList()
Returns:
a list of the SRS list of this MapLayer and its ancestors

toString

public java.lang.String toString()
Returns a somewhat nicely-formatted string representing all of the details of this layer and its sub-layers (recursively).

Overrides:
toString in class java.lang.Object
Returns:
a somewhat nicely-formatted string representing all of the details of this layer and its sub-layers (recursively).