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 classLayers.TypeThe layer type.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternCURLY_BRACESprivate static java.lang.StringDEFAULT_COLORprivate ExpressionfilterAn optional expressionprivate java.lang.StringidA required unique layer nameprivate intmaxZoomThe max zoom for the layerprivate intminZoomThe min zoom for the layerprivate static java.lang.StringPAINTprivate java.lang.StringpaintPropertiesDefault paint properties for this layerprivate static charSEMI_COLONprivate java.lang.StringsourceA source description to be used with this layer.private java.lang.StringsourceLayerLayer to use from the vector tile source.private java.lang.StringstyleIdThe id for the style -- used for image pathsprivate Layers.TypetypeThe required type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)ExpressiongetFilter()Get the filter for this layerjava.lang.StringgetId()Get the unique id for this layerjava.lang.StringgetSource()Get the source that this applies tojava.lang.StringgetSourceLayer()Get the layer that this applies toLayers.TypegetType()Get the type of this layerinthashCode()private static java.lang.StringparsePaintBackground(jakarta.json.JsonObject paintObject)private static java.lang.StringparsePaintCircle(jakarta.json.JsonObject paintObject)private static java.lang.StringparsePaintFill(jakarta.json.JsonObject paintObject)private static java.lang.StringparsePaintLine(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)private java.lang.StringparsePaintSymbol(jakarta.json.JsonObject layoutObject, jakarta.json.JsonObject paintObject)java.lang.StringtoString()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:
toStringin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-