We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesMap KitFlutterData TypesPolyline

Polyline

Defines a polyline on a map.

Properties

Expand

Name

Type

Description

polylineId

PolylineId

Unique polyline ID.

clickable

bool

Indicates whether a polyline is tappable.

color

Color

Stroke color.

geodesic

bool

Indicates whether to draw each segment of a polyline as a geodesic. The options are true (yes) and false (no).

jointType

JointType

Joint type of all vertices of a polyline, except the start and end vertices.

patterns

List<PatternItem>

Stroke pattern of a polyline. The default value is null, indicating that the stroke pattern is solid.

points

List<LatLng>

Vertexes of a polyline. Line segments are drawn between consecutive points. A polyline is not closed by default. To form a closed polyline, the start and end vertices must be the same.

startCap

Cap

Start vertex of a polyline.

endCap

Cap

End vertex of a polyline.

visible

bool

Indicates whether a polyline is visible.

width

int

Stroke width of a polyline.

zIndex

int

Z-index of a polyline, which indicates the overlapping order of the polyline.

onClick

VoidCallback?

Function executed when a polyline is tapped.

Constructors

Polyline

Expand

Parameter

Type

Description

polylineId

PolylineId

Unique polyline ID.

clickable

bool

Indicates whether a polyline is tappable.

color

Color

Stroke color.

geodesic

bool

Indicates whether to draw each segment of a polyline as a geodesic. The options are true (yes) and false (no).

jointType

JointType

Joint type of all vertices of a polyline, except the start and end vertices.

patterns

List<PatternItem>

Stroke pattern of a polyline. The default value is null, indicating that the stroke pattern is solid.

points

List<LatLng>

Vertexes of a polyline. Line segments are drawn between consecutive points. A polyline is not closed by default. To form a closed polyline, the start and end vertices must be the same.

startCap

Cap

Start vertex of a polyline.

endCap

Cap

End vertex of a polyline.

visible

bool

Indicates whether a polyline is visible.

width

int

Stroke width of a polyline.

zIndex

int

Z-index of a polyline, which indicates the overlapping order of the polyline.

onClick

VoidCallback?

Function executed when a polyline is tapped.

Method Summary

Methods

Polyline.updateCopy

Copies an existing Polyline object and updates the specified attributes.

Expand

Parameter

Type

Description

clickable

bool?

Indicates whether a polyline is tappable.

color

Color?

Stroke color.

geodesic

bool?

Indicates whether to draw each segment of a polyline as a geodesic. The options are true (yes) and false (no).

jointType

JointType?

Joint type of all vertices of a polyline, except the start and end vertices.

patterns

List<PatternItem>?

Stroke pattern of a polyline. The default value is null, indicating that the stroke pattern is solid.

points

List<LatLng>?

Vertexes of a polyline. Line segments are drawn between consecutive points. A polyline is not closed by default. To form a closed polyline, the start and end vertices must be the same.

startCap

Cap?

Start vertex of a polyline.

endCap

Cap?

End vertex of a polyline.

visible

bool?

Indicates whether a polyline is visible.

width

int?

Stroke width of a polyline.

zIndex

int?

Z-index of a polyline, which indicates the overlapping order of the polyline.

onClick

VoidCallback?

Function executed when a polyline is tapped.

Expand

Return Type

Description

Polyline

Polyline object.

Call example:

Collapse
Word wrap
Dark theme
Copy code
  1. // Define a Polyline object.
  2. Polyline polyline;
  3. // Call the updateCopy method.
  4. polyline = polyline!.updateCopy(clickable: true);

Polyline.clone

Clones a Polyline object.

Expand

Return Type

Description

Polyline

Polyline object.

Call example:

Collapse
Word wrap
Dark theme
Copy code
  1. // Define a Polyline object.
  2. Polyline polyline;
  3. Polyline polyline2;
  4. // Call the clone method.
  5. polyline2 = polyline!.clone();