Class MapLayer


  • public class MapLayer
    extends Object
    Represents a WMS Layer.
    Author:
    Chris Hodgson chodgson@refractions.net
    • 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 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 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 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 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 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 Collection getFullSRSList()
        Returns:
        a list of the SRS list of this MapLayer and its ancestors
      • toString

        public 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 Object
        Returns:
        a somewhat nicely-formatted string representing all of the details of this layer and its sub-layers (recursively).