Polyline

data class Polyline(val points: List<LatLng>, val strokeColor: Color = Color.Black, val strokeWidth: Float = 10.0f, val strokePattern: PathEffect? = null, val startCap: StrokeCap = StrokeCap.Butt, val endCap: StrokeCap = StrokeCap.Butt, val strokeJoin: StrokeJoin = StrokeJoin.Round, val geodesic: Boolean = false, val spans: List<StyleSpan> = emptyList(), val visible: Boolean = true, val clickable: Boolean = false, val zIndex: Float = 0.0f, val tag: Any? = null)(source)

Represents a polyline on the map, consisting of connected line segments.

Constructors

Link copied to clipboard
constructor(points: List<LatLng>, strokeColor: Color = Color.Black, strokeWidth: Float = 10.0f, strokePattern: PathEffect? = null, startCap: StrokeCap = StrokeCap.Butt, endCap: StrokeCap = StrokeCap.Butt, strokeJoin: StrokeJoin = StrokeJoin.Round, geodesic: Boolean = false, spans: List<StyleSpan> = emptyList(), visible: Boolean = true, clickable: Boolean = false, zIndex: Float = 0.0f, tag: Any? = null)

Properties

Link copied to clipboard

Whether the polyline is clickable. Default is false

Link copied to clipboard

Shape of the end endpoint (default: Butt)

Link copied to clipboard

Whether segments are drawn as geodesics (great-circle paths) instead of straight lines on the Mercator projection. Default is false.

Link copied to clipboard

List of geographic coordinates that define the polyline path

Link copied to clipboard

List of style spans for multi-colored polylines. When provided, overrides strokeColor for the specified segments. Default is empty (use strokeColor for all segments).

Link copied to clipboard

Shape of the start endpoint (default: Butt)

Link copied to clipboard

Color of the line stroke (default: black). Used when spans is empty.

Link copied to clipboard

Shape of line corners (default: Round)

Link copied to clipboard

Pattern for the stroke (dashed, dotted, etc.). Null means solid line (default: null)

Link copied to clipboard

Width of the line in pixels (default: 10f)

Link copied to clipboard
val tag: Any?

Optional user data associated with the polyline

Link copied to clipboard

Whether the polyline is visible. Default is true

Link copied to clipboard

Draw order. Polylines with higher zIndex are drawn on top. Default is 0.0

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int