LineStyleLayer class final

Inheritance

Constructors

LineStyleLayer({required String id, required String sourceId, String? sourceLayerId, double minZoom = 0, double maxZoom = 24, Expression<bool>? filter, bool visible = true, Expression<LineCap>? cap, Expression<LineJoin>? join, Expression<num>? miterLimit, Expression<num>? roundLimit, Expression<num>? sortKey, Expression<num>? opacity, StyleTransition? opacityTransition, Expression<num>? layerOpacity, StyleTransition? layerOpacityTransition, Expression<LineLayerBlend>? layerBlend, Expression<Color>? color, StyleTransition? colorTransition, Expression<Offset>? translate, StyleTransition? translateTransition, Expression<LineTranslateAnchor>? translateAnchor, Expression<num>? width, StyleTransition? widthTransition, Expression<num>? gapWidth, StyleTransition? gapWidthTransition, Expression<num>? offset, StyleTransition? offsetTransition, Expression<num>? blur, StyleTransition? blurTransition, Expression<List<num>>? dasharray, StyleTransition? dasharrayTransition, Expression<String>? pattern, StyleTransition? patternTransition, Expression<Color>? gradient})
Creates a LineStyleLayer that is not on a map yet.
LineStyleLayer.fromJson(Map<String, Object?> json)
Reads a LineStyleLayer from the JSON of a style layer.

Properties

blur ↔ Expression<num>
Blur applied to the line, in pixels.
getter/setter pair
blurTransition ↔ StyleTransition?
How blur changes to a new value.
getter/setter pair
cap ↔ Expression<LineCap>
The display of line endings.
getter/setter pair
color ↔ Expression<Color>
The color with which the line will be drawn.
getter/setter pair
colorTransition ↔ StyleTransition?
How color changes to a new value.
getter/setter pair
dasharray ↔ Expression<List<num>>?
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. GeoJSON sources with lineMetrics: true specified won't render dashed lines to the expected scale. Zoom-dependent expressions will be evaluated only at integer zoom levels. The only way to create an array value is using ["literal", [...]]; arrays cannot be read from or derived from feature properties.
getter/setter pair
dasharrayTransition ↔ StyleTransition?
How dasharray changes to a new value.
getter/setter pair
filter ↔ Expression<bool>?
The condition on source features. Only features that match it are shown. Zoom expressions in filters are only evaluated at integer zoom levels, and the feature-state expression is not supported in them.
getter/setter pairinherited
gapWidth ↔ Expression<num>
Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
getter/setter pair
gapWidthTransition ↔ StyleTransition?
How gapWidth changes to a new value.
getter/setter pair
gradient ↔ Expression<Color>?
Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify "lineMetrics": true.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id → String
The unique name of the layer.
finalinherited
join ↔ Expression<LineJoin>
The display of lines when joining.
getter/setter pair
layerBlend ↔ Expression<LineLayerBlend>
Controls how the layer is composited with the content already rendered beneath it. Unlike per-feature opacity properties such as line-opacity, this property affects the final composited layer output and determines how it interacts with the existing map contents.
getter/setter pair
layerOpacity ↔ Expression<num>
Opacity applied to the layer as a whole. Unlike line-opacity and alpha values in line-color, which are applied per feature and accumulate where lines overlap, line-layer-opacity is applied once so overlapping lines appear as a single surface at the given opacity. When both line-opacity and line-layer-opacity are set, the per-feature, overlap accumulation is preserved, then layer-opacity composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
getter/setter pair
layerOpacityTransition ↔ StyleTransition?
How layerOpacity changes to a new value.
getter/setter pair
maxZoom ↔ double
The maximum zoom level of the layer. At and above it, the layer is hidden.
getter/setter pairinherited
minZoom ↔ double
The minimum zoom level of the layer. Below it, the layer is hidden.
getter/setter pairinherited
miterLimit ↔ Expression<num>
Used to automatically convert miter joins to bevel joins for sharp angles.
getter/setter pair
offset ↔ Expression<num>
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.
getter/setter pair
offsetTransition ↔ StyleTransition?
How offset changes to a new value.
getter/setter pair
opacity ↔ Expression<num>
The opacity at which the line will be drawn.
getter/setter pair
opacityTransition ↔ StyleTransition?
How opacity changes to a new value.
getter/setter pair
pattern ↔ Expression<String>?
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). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
getter/setter pair
patternTransition ↔ StyleTransition?
How pattern changes to a new value.
getter/setter pair
roundLimit ↔ Expression<num>
Used to automatically convert round joins to miter joins for shallow angles.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sortKey ↔ Expression<num>?
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
getter/setter pair
sourceId → String
The id of the source of this layer.
finalinherited
sourceLayerId → String?
The layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
finalinherited
translate ↔ Expression<Offset>
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
getter/setter pair
translateAnchor ↔ Expression<LineTranslateAnchor>
Controls the frame of reference for line-translate.
getter/setter pair
translateTransition ↔ StyleTransition?
How translate changes to a new value.
getter/setter pair
type → String
The type of the layer in the style spec, such as line.
no setteroverride
visible ↔ bool
Whether the layer is shown.
getter/setter pairinherited
width ↔ Expression<num>
Stroke thickness.
getter/setter pair
widthTransition ↔ StyleTransition?
How width changes to a new value.
getter/setter pair

Methods

moveBelow(String? layerId) → void
Moves this layer below the layer layerId, or to the top if it is null. See StyleLayers.move.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The layer as the JSON of a style layer.
inherited
toString() → String
A string representation of this object.
inherited
updateFrom(StyleLayer other) → void
Sets every property of this layer that differs from other and leaves the rest alone. Only the changes reach the map.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited