目录

Polyline

Defines a polyline on a map.

Properties

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.

Constructor Summary

Constructors

[h2]Polyline

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

[h2]Polyline.updateCopy

Copies an existing Polyline object and updates the specified attributes.

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.

Return Type

Description

Polyline

Polyline object.

Call example:

// Define a Polyline object.
Polyline polyline; 
 
// Call the updateCopy method.
polyline = polyline!.updateCopy(clickable: true);

[h2]Polyline.clone

Clones a Polyline object.

Return Type

Description

Polyline

Polyline object.

Call example:

// Define a Polyline object.
Polyline polyline; 
Polyline polyline2; 
 
// Call the clone method.
polyline2 = polyline!.clone();