Polygon class

Draws a polygon through geographical locations on the map.

Implemented types
Annotations

Constructors

Polygon({required PolygonId polygonId, bool consumeTapEvents = false, Color fillColor = Colors.black, bool geodesic = false, List<LatLng> points = const <LatLng>[], List<List<LatLng>> holes = const <List<LatLng>>[], Color strokeColor = Colors.black, int strokeWidth = 10, bool visible = true, int zIndex = 0, VoidCallback? onTap})
Creates an immutable representation of a polygon through geographical locations on the map.
const

Properties

consumeTapEvents bool
True if the Polygon consumes tap events.
final
fillColor Color
Fill color in ARGB format, the same format used by Color. The default value is black (0xff000000).
final
geodesic bool
Indicates whether the segments of the polygon should be drawn as geodesics, as opposed to straight lines on the Mercator projection.
final
hashCode int
The hash code for this object.
no setteroverride
holes List<List<LatLng>>
To create an empty area within a polygon, you need to use holes. To create the hole, the coordinates defining the hole path must be inside the polygon.
final
mapsId PolygonId
A identifier for this object.
no setteroverride
onTap VoidCallback?
Callbacks to receive tap events for polygon placed on this map.
final
points List<LatLng>
The vertices of the polygon to be drawn.
final
polygonId PolygonId
Uniquely identifies a Polygon.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strokeColor Color
Line color in ARGB format, the same format used by Color. The default value is black (0xff000000).
final
strokeWidth int
Width of the polygon, used to define the width of the line to be drawn.
final
visible bool
True if the marker is visible.
final
zIndex int
The z-index of the polygon, used to determine relative drawing order of map overlays.
final

Methods

clone() Polygon
Creates a new Polygon object whose values are the same as this instance.
override
copyWith({bool? consumeTapEventsParam, Color? fillColorParam, bool? geodesicParam, List<LatLng>? pointsParam, List<List<LatLng>>? holesParam, Color? strokeColorParam, int? strokeWidthParam, bool? visibleParam, int? zIndexParam, VoidCallback? onTapParam}) Polygon
Creates a new Polygon object whose values are the same as this instance, unless overwritten by the specified parameters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
Converts this object to something serializable in JSON.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override