Skip to main content
layers

Polyline Layer

PolylineLayer draws lines on the ground: routes, borders, GPS traces. Polyline supports border strokes (borderStrokeWidth draws a second, wider line beneath) and dash and dot patterns in logical pixels.

PolylineLayer(
  polylines: [
    Polyline(points: route, strokeWidth: 6, borderStrokeWidth: 3, borderColor: Color(0xFFFFFFFF)),
    Polyline(points: detour, pattern: StrokePattern.dashed(segments: [12, 8])),
  ],
)

The demo draws the EU institutions as a GPS star: from the Commission in Brussels to the Parliament in Strasbourg, the Court of Justice in Luxembourg and the ECB in Frankfurt:

Apple MapKit (iOS)Google Maps (Android)
Routes between the EU institutionsRoutes between the EU institutions, on Google Maps