Class LayerDetails
- java.lang.Object
-
- org.openstreetmap.josm.data.imagery.LayerDetails
-
public class LayerDetails extends Object
The details of a layer of this WMS server.
-
-
Field Summary
Fields Modifier and Type Field Description private String
abstr
The layer abstract (WMSAbstract
)private Bounds
bounds
private List<LayerDetails>
children
private Collection<String>
crs
private String
name
The layer name (WMSName
)private LayerDetails
parentLayer
private Map<String,String>
styles
private String
title
The layer name (WMSTitle
)
-
Constructor Summary
Constructors Constructor Description LayerDetails(LayerDetails parentLayer)
Constructor pointing to parent layer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCrs(String crs)
Add projection supported by this layervoid
addStyle(String name, String title)
Add style to list of styles defined by this layerStream<LayerDetails>
flattened()
Returns flattened stream of this layer and its children.String
getAbstract()
Returns abstract of this layer.Bounds
getBounds()
Returns bounds within layer might be queried.List<LayerDetails>
getChildren()
Returns children layers of this layer.Collection<String>
getCrs()
Returns projections that are supported by this layer.String
getName()
Citation from OGC WMS specification (WMS 1.3.0):LayerDetails
getParent()
Returns parent layer for this layer.Map<String,String>
getStyles()
Returns styles defined for this layer.String
getTitle()
Returns "Human readable" title of this layerboolean
isSelectable()
if user may select this layer (is it possible to request it from server)void
setAbstract(String abstr)
Sets abstract of this layervoid
setBounds(Bounds bounds)
Sets bounds of this layervoid
setChildren(List<LayerDetails> children)
sets children layers for this layervoid
setName(String name)
Sets the name of this Layer.void
setTitle(String title)
Sets title of this layerString
toString()
-
-
-
Field Detail
-
crs
private final Collection<String> crs
-
parentLayer
private final LayerDetails parentLayer
-
children
private List<LayerDetails> children
-
-
Constructor Detail
-
LayerDetails
public LayerDetails(LayerDetails parentLayer)
Constructor pointing to parent layer. Set to null if this is topmost layer. This is needed to properly handle layer attributes inheritance.- Parameters:
parentLayer
- parent layer
-
-
Method Detail
-
getCrs
public Collection<String> getCrs()
Returns projections that are supported by this layer.- Returns:
- projections that are supported by this layer
-
getStyles
public Map<String,String> getStyles()
Returns styles defined for this layer.- Returns:
- styles defined for this layer
-
getTitle
public String getTitle()
Returns "Human readable" title of this layer- Returns:
- "Human readable" title of this layer
- See Also:
getName()
-
setTitle
public void setTitle(String title)
Sets title of this layer- Parameters:
title
- title of this layer- See Also:
getName()
-
getName
public String getName()
Citation from OGC WMS specification (WMS 1.3.0):A number of elements have both a <Name> and a <Title>. The Name is a text string used for machine-to-machine communication while the Title is for the benefit of humans. For example, a dataset might have the descriptive Title “Maximum Atmospheric Temperature” and be requested using the abbreviated Name “ATMAX”.
And second citation:If, and only if, a layer has a <Name>, then it is a map layer that can be requested by using that Name in the LAYERS parameter of a GetMap request. A Layer that contains a <Name> element is referred to as a “named layer” in this International Standard. If the layer has a Title but no Name, then that layer is only a category title for all the layers nested within.
- Returns:
- name of this layer
-
setName
public void setName(String name)
Sets the name of this Layer.- Parameters:
name
- the name of this Layer- See Also:
getName()
-
addStyle
public void addStyle(String name, String title)
Add style to list of styles defined by this layer- Parameters:
name
- machine-to-machine name of this styletitle
- human readable title of this style
-
addCrs
public void addCrs(String crs)
Add projection supported by this layer- Parameters:
crs
- projection code
-
getBounds
public Bounds getBounds()
Returns bounds within layer might be queried.- Returns:
- bounds within layer might be queried
-
setBounds
public void setBounds(Bounds bounds)
Sets bounds of this layer- Parameters:
bounds
- of this layer
-
getParent
public LayerDetails getParent()
Returns parent layer for this layer.- Returns:
- parent layer for this layer
-
setChildren
public void setChildren(List<LayerDetails> children)
sets children layers for this layer- Parameters:
children
- children of this layer
-
getChildren
public List<LayerDetails> getChildren()
Returns children layers of this layer.- Returns:
- children layers of this layer
-
isSelectable
public boolean isSelectable()
if user may select this layer (is it possible to request it from server)- Returns:
- true if user may select this layer, false if this layer is only grouping other layers
-
getAbstract
public String getAbstract()
Returns abstract of this layer.- Returns:
- "Narrative description of the layer"
-
setAbstract
public void setAbstract(String abstr)
Sets abstract of this layer- Parameters:
abstr
- abstract of this layer
-
flattened
public Stream<LayerDetails> flattened()
Returns flattened stream of this layer and its children.- Returns:
- flattened stream of this layer and its children (as well as recursively children of its children)
-
-