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

Update line layer #6

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 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,10 @@ class LineLayer extends Layer {
/// The color with which the line will be drawn.
int? lineColor;

/// The interpolated color
/// Needs to call "toRGBA()" before-hand for it to work
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 +126,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 +215,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
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mapbox_maps_flutter
description: A Flutter plugin for integrating Mapbox Maps SDK v10 in Android/iOS application.
version: 0.6.0
version: 0.6.1
homepage: https://github.com/mapbox/mapbox-maps-flutter

environment:
Expand Down