Class LineMBLayer
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 }, },
- Author:
- Reggie Beckwith (Boundless)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The display of line endings.static enum
(Optional) The display of lines when joining.static enum
Controls the translation reference point.Nested classes/interfaces inherited from class MBLayer
MBLayer.Visibility
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SemanticType
(Optional) Blur applied to the line, in pixels.Display of line endings.(Optional) The color with which the line will be drawn.(Optional) Specifies the lengths of the alternating dashes and gaps that form the dash pattern.(Optional) Draws a line casing outside of a line's actual path.Optional enum.(Optional) Used to automatically convert miter joins to bevel joins for sharp angles.(Optional) The line's offset.(Optional) The opacity at which the line will be drawn.(Optional) Name of image in sprite to use for drawing image lines.(Optional) Used to automatically convert round joins to bevel joins for sharp angles.int[]
(Optional) The geometry's offset.(Optional) Controls the translation reference point.(Optional) Stroke thickness.getType()
Rendering type of this layer.boolean
boolean
lineBlur()
ConvertsgetLineBlur()
to an Expression.lineCap()
MapsgetLineCap()
toStroke.getLineCap()
values of "butt", "round", and "square" Literals.MapsgetLineColor()
to anExpression
.ConvertsgetLineDasharray()
to a List of ExpressionsConvertsgetLineGapWidth()
to an Expression.lineJoin()
MapsgetLineJoin()
toStroke.getLineJoin()
values of "mitre", "round", and "bevel" Literals.MapsgetLineMiterLimit()
to anExpression
.ConvertsgetLineOffset()
to an Expression.MapsgetLineOpacity()
to anExpression
.ConvertsgetLinePattern()
to an Expression.MapsgetLineRoundLimit()
to anExpression
.WrapsgetLineTranslateAnchor()
in a GeoTools expression.MapsgetLineTranslate()
to aDisplacement
.ConvertgetLineWidth()
to an Expression.transformInternal
(MBStyle styleContext) TransformLineMBLayer
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
-
LineMBLayer
public LineMBLayer(JSONObject json)
-
-
Method Details
-
defaultSemanticType
-
getLineCap
Display of line endings.Supports piecewise constant functions.
- Returns:
- One of butt, round, square, optional defaults to butt.
-
lineCap
MapsgetLineCap()
toStroke.getLineCap()
values of "butt", "round", and "square" Literals. Defaults to butt.Since piecewise constant functions is supported a
RecodeFunction
may be generated.- Returns:
- Expression for
Stroke.getLineCap()
use.
-
getLineJoin
Optional enum. One of bevel, round, miter. Defaults to miter. The display of lines when joining.- Returns:
- The line join
-
lineJoin
MapsgetLineJoin()
toStroke.getLineJoin()
values of "mitre", "round", and "bevel" Literals. Defaults to "mitre".Since piecewise constant functions is supported a
RecodeFunction
may be generated.- Returns:
- Expression for
Stroke.getLineJoin()
use.
-
getLineMiterLimit
(Optional) Used to automatically convert miter joins to bevel joins for sharp angles.Defaults to 2. Requires line-join = miter.
- Returns:
- The threshold at which miter joins are converted to bevel joins.
-
lineMiterLimit
MapsgetLineMiterLimit()
to anExpression
. (Optional) Used to automatically convert miter joins to bevel joins for sharp angles.Defaults to 2. Requires line-join = miter.
- Returns:
- Expression for
getLineMiterLimit()
-
getLineRoundLimit
(Optional) Used to automatically convert round joins to bevel joins for sharp angles.Defaults to 1.05. Requires line-join = round.
- Returns:
- The threshold at which round joins are converted to bevel joins.
-
lineRoundLimit
MapsgetLineRoundLimit()
to anExpression
.(Optional) Used to automatically convert round joins to bevel joins for sharp angles.
Defaults to 1.05. Requires line-join = round.
- Returns:
- Expression providing threshold at which round joins are converted to bevel joins.
-
getLineOpacity
(Optional) The opacity at which the line will be drawn.Defaults to 1.
- Returns:
- The line opacity
-
lineOpacity
MapsgetLineOpacity()
to anExpression
.(Optional) The opacity at which the line will be drawn.
Defaults to 1.
- Returns:
- opacity for line (literal or function), defaults to 1.
-
getLineColor
(Optional) The color with which the line will be drawn.Defaults to
Color.BLACK
, disabled by line-pattern.- Returns:
- color to draw the line, optional defaults to black.
-
lineColor
MapsgetLineColor()
to anExpression
.(Optional) The color with which the line will be drawn.
Defaults to
Color.BLACK
, disabled by line-pattern.- Returns:
- color to draw the line, optional defaults to black.
-
getLineTranslate
public int[] getLineTranslate()(Optional) The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.Units in pixels. Defaults to 0,0.
- Returns:
- The geometry's offset.
-
lineTranslateDisplacement
MapsgetLineTranslate()
to aDisplacement
.(Optional) The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
Units in pixels. Defaults to 0,0.
- Returns:
- The geometry's offset, as a Displacement.
-
getLineTranslateAnchor
(Optional) Controls the translation reference point.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.- Returns:
- The translation reference point.
-
lineTranslateAnchor
WrapsgetLineTranslateAnchor()
in a GeoTools expression. Returns an expression that evaluates to "map" or "viewport".- Returns:
- Expression providing translation reference point.
-
getLineWidth
(Optional) Stroke thickness.Units in pixels. Defaults to 1.
- Returns:
- The stroke thickness.
-
lineWidth
ConvertgetLineWidth()
to an Expression.(Optional) Stroke thickness. Units in pixels. Defaults to 1.
- Returns:
- The stroke thickness.
-
getLineGapWidth
(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.
- Returns:
- The inner gap between the sides of the line casing
-
lineGapWidth
ConvertsgetLineGapWidth()
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.
- Returns:
- The inner gap between the sides of the line casing
-
getLineOffset
(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.
- Returns:
- The line's offset.
-
lineOffset
ConvertsgetLineOffset()
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.
- Returns:
- The line's offset.
-
getLineBlur
(Optional) Blur applied to the line, in pixels.Units in pixels. Defaults to 0.
- Returns:
- The line blur.
-
lineBlur
ConvertsgetLineBlur()
to an Expression.(Optional) Blur applied to the line, in pixels.
Units in pixels. Defaults to 0.
- Returns:
- The line blur.
-
getLineDasharray
(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.
- Returns:
- A list of dash and gap lengths defining the pattern for a dashed line.
-
lineDasharray
ConvertsgetLineDasharray()
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.
- Returns:
- A list of dash and gap lengths defining the pattern for a dashed line.
-
getLinePattern
(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.
- Returns:
- The name of the sprite to use for the line pattern.
-
linePattern
ConvertsgetLinePattern()
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.
- Returns:
- Expression providing name of the sprite to use for the line pattern.
-
hasLinePattern
public boolean hasLinePattern()- Returns:
- True if the layer has a line-pattern explicitly provided.
-
hasLineGapWidth
public boolean hasLineGapWidth()- Returns:
- True if the layer has a line-gap-width explicitly provided.
-
transformInternal
TransformLineMBLayer
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
-
getType
Rendering type of this layer.
-