public class FillMBLayer extends MBLayer
Example of line JSON:
{ "type": "line",
"source": "http://localhost:8080/geoserver/ne/roads",
"source-layer": "road"
"id": "roads",
"paint": {
"fill-anitalias": true,
"fill-opacity": 1
"fill-color": "#6655ae",
"fill-outline-color": "#000000",
"fill-translate": [0,0],
"fill-translate-anchor": "map",
"fill-pattern": "triangle" // Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
},
},
| Modifier and Type | Class and Description |
|---|---|
static class |
FillMBLayer.FillTranslateAnchor
Controls the translation reference point.
|
MBLayer.Visibility| Constructor and Description |
|---|
FillMBLayer(JSONObject json) |
| Modifier and Type | Method and Description |
|---|---|
protected SemanticType |
defaultSemanticType()
Default
SemanticType to use when generating MBLayer.getFilter(). |
Expression |
fillColor()
Access fill-color as literal or function expression, defaults to black.
|
Expression |
fillOpacity()
Access fill-opacity, defaults to 1.
|
Expression |
fillOutlineColor()
Access fill-outline-color as literal or function expression, defaults to black.
|
Expression |
fillPattern()
(Optional) Name of image in a sprite to use for drawing image fills.
|
Point |
fillTranslate()
Access fill-translate as Point.
|
Displacement |
fillTranslateDisplacement()
Processes the filter-translate into a Displacement.
|
Expression |
getFillAntialias()
(Optional) Whether or not the fill should be antialiased.
|
Color |
getFillColor()
(Optional).
|
Number |
getFillOpacity()
(Optional) The opacity of the entire fill layer.
|
Color |
getFillOutlineColor()
(Optional).
|
int[] |
getFillTranslate()
(Optional) The geometry's offset.
|
FillMBLayer.FillTranslateAnchor |
getFillTranslateAnchor()
(Optional) Controls the translation reference point.
|
String |
getType()
Rendering type of this layer.
|
boolean |
hasFillPattern() |
List<FeatureTypeStyle> |
transformInternal(MBStyle styleContext)
Transform MBFillLayer to GeoTools FeatureTypeStyle.
|
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibilityprotected SemanticType defaultSemanticType()
MBLayerSemanticType to use when generating MBLayer.getFilter().
Use ANY to match all geometry, or fill in LINE, POINT, POLYGON if needed.
public Expression getFillAntialias()
Defaults to true.
public Number getFillOpacity() throws MBFormatException
Defaults to 1.
MBFormatException - JSON provided inconsistent with specificationpublic Expression fillOpacity() throws MBFormatException
MBFormatException - JSON provided inconsistent with specificationpublic Color getFillColor()
Colors are written as JSON strings in a variety of permitted formats.
Defaults to #000000. Disabled by fill-pattern.
public Expression fillColor()
public Color getFillOutlineColor()
Matches the value of fill-color if unspecified. Disabled by fill-pattern.
public Expression fillOutlineColor()
public int[] getFillTranslate()
public Point fillTranslate()
public Displacement fillTranslateDisplacement()
This should handle both literals and function stops:
filter-translate: [0,0]
filter-translate: { property: "building-height", "stops": [[0,[0,0]],[5,[1,2]]] }
filter-translate: [ 0, { property: "building-height", "TYPE":"exponential","stops": [[0,0],[30, 5]] }
public FillMBLayer.FillTranslateAnchor getFillTranslateAnchor()
FillMBLayer.FillTranslateAnchor.MAP: The fill is translated relative to the map.
FillMBLayer.FillTranslateAnchor.VIEWPORT: The fill is translated relative to the viewport.
public Expression fillPattern()
public boolean hasFillPattern()
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext)
Notes:
transformInternal in class MBLayerstyleContext - The MBStyle to which this layer belongs, used as a context for things
like resolving sprite and glyph names to full urls.Copyright © 1996–2021 Geotools. All rights reserved.