Skip to content

Commit

Permalink
dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
mootw committed Jan 5, 2024
1 parent 5adede5 commit 056daf8
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions lib/src/layer/polyline_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,31 @@ class PolylineLayer extends StatelessWidget {

final renderedLines = <Polyline>[];


final possiblySimplifiedPolylines = <Polyline>[];
if (simplificationTolerance != null) {
possiblySimplifiedPolylines.addAll(polylines.map((polyline) => Polyline(
points: simplify(
polyline.points,
simplificationTolerance! /
math.pow(2, mapCamera.zoom.floorToDouble()),
highestQuality: simplificationHighQuality),
borderColor: polyline.borderColor,
borderStrokeWidth: polyline.borderStrokeWidth,
color: polyline.color,
colorsStop: polyline.colorsStop,
gradientColors: polyline.gradientColors,
isDotted: polyline.isDotted,
strokeCap: polyline.strokeCap,
strokeJoin: polyline.strokeJoin,
strokeWidth: polyline.strokeWidth,
useStrokeWidthInMeter: polyline.useStrokeWidthInMeter,
)));
if (simplificationTolerance != null) {
possiblySimplifiedPolylines.addAll(polylines.map((polyline) => Polyline(
points: simplify(
polyline.points,
simplificationTolerance! /
math.pow(2, mapCamera.zoom.floorToDouble()),
highestQuality: simplificationHighQuality),
borderColor: polyline.borderColor,
borderStrokeWidth: polyline.borderStrokeWidth,
color: polyline.color,
colorsStop: polyline.colorsStop,
gradientColors: polyline.gradientColors,
isDotted: polyline.isDotted,
strokeCap: polyline.strokeCap,
strokeJoin: polyline.strokeJoin,
strokeWidth: polyline.strokeWidth,
useStrokeWidthInMeter: polyline.useStrokeWidthInMeter,
)));
} else {
possiblySimplifiedPolylines.addAll(polylines);
}

if (polylineCullingMargin == null) {
renderedLines.addAll(possiblySimplifiedPolylines);
renderedLines.addAll(possiblySimplifiedPolylines);
} else {
final bounds = mapCamera.visibleBounds;
final margin =
Expand Down

0 comments on commit 056daf8

Please sign in to comment.