Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

update line layer #5

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/src/style/layer/line_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class LineLayer extends Layer {
this.lineSortKey,
this.lineBlur,
this.lineColor,
this.lineColors,
this.lineDasharray,
this.lineGapWidth,
this.lineGradient,
Expand Down Expand Up @@ -60,6 +61,9 @@ class LineLayer extends Layer {
/// The color with which the line will be drawn.
int? lineColor;

/// The colors interpolated
List<dynamic>? lineColors;

/// 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. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
List<double?>? lineDasharray;

Expand Down Expand Up @@ -121,6 +125,9 @@ class LineLayer extends Layer {
if (lineColor != null) {
paint["line-color"] = lineColor?.toRGBA();
}
if (lineColors != null) {
paint["line-color"] = lineColors;
}
if (lineDasharray != null) {
paint["line-dasharray"] = lineDasharray;
}
Expand Down Expand Up @@ -207,6 +214,7 @@ class LineLayer extends Layer {
lineSortKey: map["layout"]["line-sort-key"] is num? ? (map["layout"]["line-sort-key"] as num?)?.toDouble() : null,
lineBlur: map["paint"]["line-blur"] is num? ? (map["paint"]["line-blur"] as num?)?.toDouble() : null,
lineColor: (map["paint"]["line-color"] as List?)?.toRGBAInt(),
lineColors: (map["paint"]["line-color"] as List?),
lineDasharray: (map["paint"]["line-dasharray"] as List?)?.map<double?>((e) => e.toDouble()).toList(),
lineGapWidth:
map["paint"]["line-gap-width"] is num? ? (map["paint"]["line-gap-width"] as num?)?.toDouble() : null,
Expand Down