Class Layers
- java.lang.Object
-
- org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.Layers
-
public class Layers extends java.lang.Object
Mapbox style layers- Since:
- 17862
- See Also:
- https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Layers.Type
The layer type.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
CURLY_BRACES
private static java.lang.String
DEFAULT_COLOR
private Expression
filter
An optional expressionprivate java.lang.String
id
A required unique layer nameprivate int
maxZoom
The max zoom for the layerprivate int
minZoom
The min zoom for the layerprivate static java.lang.String
PAINT
private java.lang.String
paintProperties
Default paint properties for this layerprivate static char
SEMI_COLON
private java.lang.String
source
A source description to be used with this layer.private java.lang.String
sourceLayer
Layer to use from the vector tile source.private java.lang.String
styleId
The id for the style -- used for image pathsprivate Layers.Type
type
The required type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Expression
getFilter()
Get the filter for this layerjava.lang.String
getId()
Get the unique id for this layerjava.lang.String
getSource()
Get the source that this applies tojava.lang.String
getSourceLayer()
Get the layer that this applies toLayers.Type
getType()
Get the type of this layerint
hashCode()
private static java.lang.String
parsePaintBackground(jakarta.json.JsonObject paintObject)
private static java.lang.String
parsePaintCircle(jakarta.json.JsonObject paintObject)
private static java.lang.String
parsePaintFill(jakarta.json.JsonObject paintObject)
private static java.lang.String
parsePaintLine(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)
private java.lang.String
parsePaintSymbol(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)
java.lang.String
toString()
Converts this layer object to a mapcss entry string (to be parsed later)
-
-
-
Field Detail
-
DEFAULT_COLOR
private static final java.lang.String DEFAULT_COLOR
- See Also:
- Constant Field Values
-
SEMI_COLON
private static final char SEMI_COLON
- See Also:
- Constant Field Values
-
CURLY_BRACES
private static final java.util.regex.Pattern CURLY_BRACES
-
PAINT
private static final java.lang.String PAINT
- See Also:
- Constant Field Values
-
id
private final java.lang.String id
A required unique layer name
-
type
private final Layers.Type type
The required type
-
filter
private final Expression filter
An optional expression
-
maxZoom
private final int maxZoom
The max zoom for the layer
-
minZoom
private final int minZoom
The min zoom for the layer
-
paintProperties
private final java.lang.String paintProperties
Default paint properties for this layer
-
source
private final java.lang.String source
A source description to be used with this layer. Required for everything butLayers.Type.BACKGROUND
-
sourceLayer
private final java.lang.String sourceLayer
Layer to use from the vector tile source. Only allowed withSourceType.VECTOR
.
-
styleId
private final java.lang.String styleId
The id for the style -- used for image paths
-
-
Constructor Detail
-
Layers
public Layers(jakarta.json.JsonObject layerInfo)
Create a layer object- Parameters:
layerInfo
- The info to use to create the layer
-
Layers
public Layers(java.lang.String styleId, jakarta.json.JsonObject layerInfo)
Create a layer object- Parameters:
styleId
- The id for the style (image paths require this)layerInfo
- The info to use to create the layer
-
-
Method Detail
-
getFilter
public Expression getFilter()
Get the filter for this layer- Returns:
- The filter
-
getId
public java.lang.String getId()
Get the unique id for this layer- Returns:
- The unique id
-
getType
public Layers.Type getType()
Get the type of this layer- Returns:
- The layer type
-
parsePaintLine
private static java.lang.String parsePaintLine(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)
-
parsePaintCircle
private static java.lang.String parsePaintCircle(jakarta.json.JsonObject paintObject)
-
parsePaintSymbol
private java.lang.String parsePaintSymbol(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)
-
parsePaintBackground
private static java.lang.String parsePaintBackground(jakarta.json.JsonObject paintObject)
-
parsePaintFill
private static java.lang.String parsePaintFill(jakarta.json.JsonObject paintObject)
-
toString
public java.lang.String toString()
Converts this layer object to a mapcss entry string (to be parsed later)- Overrides:
toString
in classjava.lang.Object
- Returns:
- The mapcss entry (string form)
-
getSource
public java.lang.String getSource()
Get the source that this applies to- Returns:
- The source name
-
getSourceLayer
public java.lang.String getSourceLayer()
Get the layer that this applies to- Returns:
- The layer name
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-