Package org.geotools.mbstyle.layer
Class BackgroundMBLayer
The background color or pattern of the map.
MBLayer wrapper around a JSONObject
representation of a "background" type latyer. All methods act as
accessors on provided JSON layer, no other state is maintained. This allows modifications to be made cleanly with out
chance of side-effect.
- get methods: access the json directly
- query methods: provide logic / transforms to GeoTools classes as required.
-
Nested Class Summary
Nested classes/interfaces inherited from class MBLayer
MBLayer.Visibility
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMapsgetBackgroundColor()
to anExpression
.MapsgetBackgroundOpacity()
to anExpression
.MapsgetBackgroundPattern()
to anExpression
.protected SemanticType
Optional color.Optional number.Optional string.getType()
Rendering type of this layer.boolean
transformInternal
(MBStyle styleContext) TransformBackgroundMBLayer
to GeoTools FeatureTypeStyle.Methods inherited from class MBLayer
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibility
-
Constructor Details
-
BackgroundMBLayer
public BackgroundMBLayer(JSONObject json)
-
-
Method Details
-
defaultSemanticType
-
getBackgroundColor
Optional color. Defaults to #000000. Disabled by background-pattern.- Returns:
- The color with which the background will be drawn.
-
backgroundColor
MapsgetBackgroundColor()
to anExpression
.Optional color. Defaults to #000000. Disabled by background-pattern.
- Returns:
- The color with which the background will be drawn.
-
getBackgroundPattern
Optional string. Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).- Returns:
- Name of image in sprite to use for drawing an image background, or null if not defined.
-
hasBackgroundPattern
public boolean hasBackgroundPattern()- Returns:
- True if the layer has a background-pattern explicitly provided.
-
backgroundPattern
MapsgetBackgroundPattern()
to anExpression
.Optional string. Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
- Returns:
- Name of image in sprite to use for drawing an image background, or null if not defined.
-
getBackgroundOpacity
Optional number. Defaults to 1.- Returns:
- The opacity at which the background will be drawn.
-
backgroundOpacity
- Returns:
- The opacity at which the background will be drawn.
-
transformInternal
TransformBackgroundMBLayer
to GeoTools FeatureTypeStyle.- Specified by:
transformInternal
in classMBLayer
- Parameters:
styleContext
- The MBStyle to which this layer belongs, used as a context for things like resolving sprite and glyph names to full urls.- Returns:
- FeatureTypeStyle
-
getFill
-
getType
Rendering type of this layer.
-