Package org.locationtech.jts.wms
Class MapLayer
- java.lang.Object
-
- org.locationtech.jts.wms.MapLayer
-
public class MapLayer extends Object
Represents a WMS Layer.- Author:
- Chris Hodgson chodgson@refractions.net
-
-
Constructor Summary
Constructors Constructor Description MapLayer(String name, String title, Collection srsList, Collection subLayers, BoundingBox bbox)
Creates a new instance of MapLayer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundingBox
getBoundingBox()
Gets the LatLonBoundingBox for this layer.Collection
getFullSRSList()
ArrayList
getLayerList()
Returns a list of all the layers in order of a root-left-right traversal of the layer tree.String
getName()
Gets the name of this Layer.MapLayer
getParent()
Gets the parent MapLayer of this MapLayer.ArrayList
getSRSList()
Returns a copy of the list of supported SRS's.MapLayer
getSubLayer(int n)
Returns the sub-layer at the specified index.ArrayList
getSubLayerList()
Gets a copy of the list of the sublayers of this layer.String
getTitle()
Gets the title of this MapLayer.int
numSubLayers()
Returns the number of sub-layers that this MapLayer has.String
toString()
Returns a somewhat nicely-formatted string representing all of the details of this layer and its sub-layers (recursively).
-
-
-
Constructor Detail
-
MapLayer
public MapLayer(String name, String title, Collection srsList, 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 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).
-
-