Class LayerDetails
- java.lang.Object
-
- org.openstreetmap.josm.data.imagery.LayerDetails
-
public class LayerDetails extends java.lang.Object
The details of a layer of this WMS server.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
abstr
The layer abstract (WMSAbstract
)private Bounds
bounds
private java.util.List<LayerDetails>
children
private java.util.Collection<java.lang.String>
crs
private java.lang.String
name
The layer name (WMSName
)private LayerDetails
parentLayer
private java.util.Map<java.lang.String,java.lang.String>
styles
private java.lang.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(java.lang.String crs)
Add projection supported by this layervoid
addStyle(java.lang.String name, java.lang.String title)
Add style to list of styles defined by this layerjava.util.stream.Stream<LayerDetails>
flattened()
Returns flattened stream of this layer and its children.java.lang.String
getAbstract()
Returns abstract of this layer.Bounds
getBounds()
Returns bounds within layer might be queried.java.util.List<LayerDetails>
getChildren()
Returns children layers of this layer.java.util.Collection<java.lang.String>
getCrs()
Returns projections that are supported by this layer.java.lang.String
getName()
Citation from OGC WMS specification (WMS 1.3.0):LayerDetails
getParent()
Returns parent layer for this layer.java.util.Map<java.lang.String,java.lang.String>
getStyles()
Returns styles defined for this layer.java.lang.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(java.lang.String abstr)
Sets abstract of this layervoid
setBounds(Bounds bounds)
Sets bounds of this layervoid
setChildren(java.util.List<LayerDetails> children)
sets children layers for this layervoid
setName(java.lang.String name)
Sets the name of this Layer.void
setTitle(java.lang.String title)
Sets title of this layerjava.lang.String
toString()
-
-
-
Field Detail
-
styles
private final java.util.Map<java.lang.String,java.lang.String> styles
-
crs
private final java.util.Collection<java.lang.String> crs
-
title
private java.lang.String title
The layer name (WMSTitle
)
-
name
private java.lang.String name
The layer name (WMSName
)
-
abstr
private java.lang.String abstr
The layer abstract (WMSAbstract
)- Since:
- 13199
-
parentLayer
private final LayerDetails parentLayer
-
children
private java.util.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 java.util.Collection<java.lang.String> getCrs()
Returns projections that are supported by this layer.- Returns:
- projections that are supported by this layer
-
getStyles
public java.util.Map<java.lang.String,java.lang.String> getStyles()
Returns styles defined for this layer.- Returns:
- styles defined for this layer
-
getTitle
public java.lang.String getTitle()
Returns "Human readable" title of this layer- Returns:
- "Human readable" title of this layer
- See Also:
getName()
-
setTitle
public void setTitle(java.lang.String title)
Sets title of this layer- Parameters:
title
- title of this layer- See Also:
getName()
-
getName
public java.lang.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(java.lang.String name)
Sets the name of this Layer.- Parameters:
name
- the name of this Layer- See Also:
getName()
-
addStyle
public void addStyle(java.lang.String name, java.lang.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(java.lang.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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getParent
public LayerDetails getParent()
Returns parent layer for this layer.- Returns:
- parent layer for this layer
-
setChildren
public void setChildren(java.util.List<LayerDetails> children)
sets children layers for this layer- Parameters:
children
- children of this layer
-
getChildren
public java.util.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 java.lang.String getAbstract()
Returns abstract of this layer.- Returns:
- "Narrative description of the layer"
-
setAbstract
public void setAbstract(java.lang.String abstr)
Sets abstract of this layer- Parameters:
abstr
- abstract of this layer
-
flattened
public java.util.stream.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)
-
-