Polygon

data class Polygon(val points: List<LatLng>, val strokeColor: Int = Color.BLACK, val strokeWidth: Float = 10.0f, val fillColor: Int = Color.argb(128, 128, 128, 128), val holes: List<List<LatLng>> = emptyList(), val visible: Boolean = true, val clickable: Boolean = false, val zIndex: Float = 0.0f, val tag: Any? = null)(source)

Represents a polygon on the map, consisting of a closed shape with optional holes.

Constructors

Link copied to clipboard
constructor(points: List<LatLng>, strokeColor: Int = Color.BLACK, strokeWidth: Float = 10.0f, fillColor: Int = Color.argb(128, 128, 128, 128), holes: List<List<LatLng>> = emptyList(), visible: Boolean = true, clickable: Boolean = false, zIndex: Float = 0.0f, tag: Any? = null)

Properties

Link copied to clipboard

Whether the polygon is clickable. Default is false

Link copied to clipboard

Fill color for the polygon interior (default: semi-transparent gray)

Link copied to clipboard

List of hole definitions, where each hole is a list of LatLng points

Link copied to clipboard

List of geographic coordinates that define the polygon outline. The polygon is automatically closed between the last and first point.

Link copied to clipboard

Color of the polygon outline (default: black)

Link copied to clipboard

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

Link copied to clipboard
val tag: Any?

Optional user data associated with the polygon

Link copied to clipboard

Whether the polygon is visible. Default is true

Link copied to clipboard

Draw order. Polygons 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