public class LineMBLayer extends MBLayer
Example of line JSON:
{ "type": "line", "source": "http://localhost:8080/geoserver/ne/roads", "source-layer": "road" "id": "roads", "paint": { "line-color": "#6655ae", "line-width": 2, "line-opacity": 1 }, },
Modifier and Type | Class and Description |
---|---|
static class |
LineMBLayer.LineCap
The display of line endings.
|
static class |
LineMBLayer.LineJoin
(Optional) The display of lines when joining.
|
static class |
LineMBLayer.LineTranslateAnchor
Controls the translation reference point.
|
MBLayer.Visibility
Constructor and Description |
---|
LineMBLayer(JSONObject json) |
Modifier and Type | Method and Description |
---|---|
protected SemanticType |
defaultSemanticType()
Default
SemanticType to use when generating MBLayer.getFilter() . |
Number |
getLineBlur()
(Optional) Blur applied to the line, in pixels.
|
LineMBLayer.LineCap |
getLineCap()
Display of line endings.
|
Color |
getLineColor()
(Optional) The color with which the line will be drawn.
|
List<Double> |
getLineDasharray()
(Optional) Specifies the lengths of the alternating dashes and gaps that form the dash
pattern.
|
Number |
getLineGapWidth()
(Optional) Draws a line casing outside of a line's actual path.
|
LineMBLayer.LineJoin |
getLineJoin()
Optional enum.
|
Number |
getLineMiterLimit()
(Optional) Used to automatically convert miter joins to bevel joins for sharp angles.
|
Number |
getLineOffset()
(Optional) The line's offset.
|
Number |
getLineOpacity()
(Optional) The opacity at which the line will be drawn.
|
String |
getLinePattern()
(Optional) Name of image in sprite to use for drawing image lines.
|
Number |
getLineRoundLimit()
(Optional) Used to automatically convert round joins to bevel joins for sharp angles.
|
int[] |
getLineTranslate()
(Optional) The geometry's offset.
|
LineMBLayer.LineTranslateAnchor |
getLineTranslateAnchor()
(Optional) Controls the translation reference point.
|
Number |
getLineWidth()
(Optional) Stroke thickness.
|
String |
getType()
Rendering type of this layer.
|
boolean |
hasLineGapWidth() |
boolean |
hasLinePattern() |
Expression |
lineBlur()
Converts
getLineBlur() to an Expression. |
Expression |
lineCap()
Maps
getLineCap() to Stroke.getLineCap() values of "butt", "round", and
"square" Literals. |
Expression |
lineColor()
Maps
getLineColor() to an Expression . |
List<Expression> |
lineDasharray()
Converts
getLineDasharray() to a List of Expressions
(Optional) Specifies the lengths of the alternating dashes and gaps that form the dash
pattern. |
Expression |
lineGapWidth()
Converts
getLineGapWidth() to an Expression. |
Expression |
lineJoin()
Maps
getLineJoin() to Stroke.getLineJoin() values of "mitre", "round", and
"bevel" Literals. |
Expression |
lineMiterLimit()
Maps
getLineMiterLimit() to an Expression . |
Expression |
lineOffset()
Converts
getLineOffset() to an Expression. |
Expression |
lineOpacity()
Maps
getLineOpacity() to an Expression . |
Expression |
linePattern()
Converts
getLinePattern() to an Expression. |
Expression |
lineRoundLimit()
Maps
getLineRoundLimit() to an Expression . |
Expression |
lineTranslateAnchor()
Wraps
getLineTranslateAnchor() in a GeoTools expression. |
Displacement |
lineTranslateDisplacement()
Maps
getLineTranslate() to a Displacement . |
Expression |
lineWidth()
Convert
getLineWidth() to an Expression. |
List<FeatureTypeStyle> |
transformInternal(MBStyle styleContext)
Transform
LineMBLayer to GeoTools FeatureTypeStyle. |
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibility
protected SemanticType defaultSemanticType()
MBLayer
SemanticType
to use when generating MBLayer.getFilter()
.
Use ANY to match all geometry, or fill in LINE, POINT, POLYGON if needed.
public LineMBLayer.LineCap getLineCap()
Supports piecewise constant functions.
public Expression lineCap()
getLineCap()
to Stroke.getLineCap()
values of "butt", "round", and
"square" Literals. Defaults to butt.
Since piecewise constant functions is supported a RecodeFunction
may be generated.
Stroke.getLineCap()
use.public LineMBLayer.LineJoin getLineJoin()
public Expression lineJoin()
getLineJoin()
to Stroke.getLineJoin()
values of "mitre", "round", and
"bevel" Literals. Defaults to "mitre".
Since piecewise constant functions is supported a RecodeFunction
may be generated.
Stroke.getLineJoin()
use.public Number getLineMiterLimit()
Defaults to 2. Requires line-join = miter.
public Expression lineMiterLimit()
getLineMiterLimit()
to an Expression
. (Optional) Used to automatically
convert miter joins to bevel joins for sharp angles.
Defaults to 2. Requires line-join = miter.
getLineMiterLimit()
public Number getLineRoundLimit()
Defaults to 1.05. Requires line-join = round.
public Expression lineRoundLimit()
getLineRoundLimit()
to an Expression
.
(Optional) Used to automatically convert round joins to bevel joins for sharp angles.
Defaults to 1.05. Requires line-join = round.
public Number getLineOpacity()
Defaults to 1.
public Expression lineOpacity()
getLineOpacity()
to an Expression
.
(Optional) The opacity at which the line will be drawn.
Defaults to 1.
public Color getLineColor()
Defaults to Color.BLACK
, disabled by line-pattern.
public Expression lineColor()
getLineColor()
to an Expression
.
(Optional) The color with which the line will be drawn.
Defaults to Color.BLACK
, disabled by line-pattern.
public int[] getLineTranslate()
Units in pixels. Defaults to 0,0.
public Displacement lineTranslateDisplacement()
getLineTranslate()
to a Displacement
.
(Optional) The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
Units in pixels. Defaults to 0,0.
public LineMBLayer.LineTranslateAnchor getLineTranslateAnchor()
LineMBLayer.LineTranslateAnchor.MAP
: The fill is translated relative to the map.
LineMBLayer.LineTranslateAnchor.VIEWPORT
: The fill is translated relative to the viewport.
Defaults to LineMBLayer.LineTranslateAnchor.MAP
. Requires fill-translate.
public Expression lineTranslateAnchor()
getLineTranslateAnchor()
in a GeoTools expression. Returns an expression that
evaluates to "map" or "viewport".public Number getLineWidth()
Units in pixels. Defaults to 1.
public Expression lineWidth()
getLineWidth()
to an Expression.
(Optional) Stroke thickness. Units in pixels. Defaults to 1.
public Number getLineGapWidth()
Units in pixels. Defaults to 0.
public Expression lineGapWidth()
getLineGapWidth()
to an Expression.
(Optional) Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
Units in pixels. Defaults to 0.
public Number getLineOffset()
Units in pixels. Defaults to 0.
public Expression lineOffset()
getLineOffset()
to an Expression.
(Optional) The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
Units in pixels. Defaults to 0.
public Number getLineBlur()
Units in pixels. Defaults to 0.
public Expression lineBlur()
getLineBlur()
to an Expression.
(Optional) Blur applied to the line, in pixels.
Units in pixels. Defaults to 0.
public List<Double> getLineDasharray()
Units in line widths. Disabled by line-pattern.
public List<Expression> lineDasharray()
getLineDasharray()
to a List of Expressions
(Optional) Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.
Units in line widths. Disabled by line-pattern.
public String getLinePattern()
Units in line widths. Disabled by line-pattern.
public Expression linePattern()
getLinePattern()
to an Expression.
(Optional) Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).
Units in line widths. Disabled by line-pattern.
public boolean hasLinePattern()
public boolean hasLineGapWidth()
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext)
LineMBLayer
to GeoTools FeatureTypeStyle.transformInternal
in class MBLayer
styleContext
- The MBStyle to which this layer belongs, used as a context for things
like resolving sprite and glyph names to full urls.Copyright © 1996–2023 Geotools. All rights reserved.