Polygon Layer
PolygonLayer fills and outlines areas. Polygon keeps flutter_map's fields — points, holePointsList,
color, borderColor, borderStrokeWidth — drawn natively on Google Maps and MapKit, by flutter_map elsewhere.
PolygonLayer(
polygons: [
Polygon(points: countryBorder, color: Color(0x66009688), borderStrokeWidth: 2),
],
)
The demo outlines every European country, shows the tapped one's name, and highlights it on tap:
| Apple MapKit (iOS) | Google Maps (Android) |
|---|---|
![]() | ![]() |
Holes and taps
- Holes (
holePointsList) are supported. - A tap is resolved in Dart through the layer's hit tester — pass a
hitNotifiertoPolygonLayerand read the tapped polygon inMapOptions.onTap.
Stroke style
pattern, strokeCap and strokeJoin reach both native maps:
| Android (Google Maps) | iOS, macOS (MapKit) | |
|---|---|---|
pattern | strokePattern, in physical pixels | lineDashPattern, compensated for the cap added to each dash |
strokeJoin | strokeJointType | lineJoin, with Flutter's miter limit of 4 |
strokeCap | dash ends drawn by the platform | lineCap at the dash ends |
A cap only ever shows at the ends of dashes, since a polygon's outline is closed: on a solid outline strokeCap
changes nothing. disableHolesBorder is drawn by composition natively — the polygon without its stroke, plus its
outer ring as a line.

