PolygonOptions

Builder class for creating Polygon instances with a fluent API. A builder for polygon configuration.

Example usage:

val polygon = PolygonOptions()
.add(LatLng(51.5, 0.0))
.add(LatLng(51.6, 0.0))
.add(LatLng(51.6, 0.1))
.strokeColor(Color.Red)
.fillColor(Color(red = 255, green = 0, blue = 0, alpha = 128))
.clickable(true)

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Adds a vertex to the outline of the polygon.

fun add(vararg points: LatLng): PolygonOptions

Adds several vertices in order, e.g. add(a, b, c) from Java.

Link copied to clipboard

Adds vertices to the outline of the polygon.

Link copied to clipboard

Adds a hole to the polygon.

Link copied to clipboard

Sets whether the polygon is clickable.

Link copied to clipboard

Sets the fill color of the polygon interior.

Sets the fill color of the polygon interior as an ARGB color int. Use this overload from Java, e.g. with android.graphics.Color.RED or 0x800000FF.

Link copied to clipboard

Sets whether segments are drawn as geodesics (great-circle paths).

Link copied to clipboard

Sets the stroke pattern as dots, dashes and gaps, e.g. listOf(Dot(), Gap(20f)). It is used instead of a strokePattern if not null.

Link copied to clipboard

Sets the stroke cap style for line endpoints.

Sets the shape of line ends, e.g. strokeCap(new RoundCap()) from Java.

Link copied to clipboard

Sets the stroke color of the polygon outline.

Sets the stroke color of the polygon outline as an ARGB color int. Use this overload from Java, e.g. with android.graphics.Color.RED or 0x800000FF.

Link copied to clipboard

Sets the stroke join style for line corners.

Link copied to clipboard

Sets the shape of the corners from a JointType constant, e.g. strokeJointType(JointType.ROUND).

Link copied to clipboard

Sets the stroke pattern from an android.graphics.PathEffect, e.g. a DashPathEffect from Java.

Sets the stroke pattern of the polygon outline (dashed, dotted, etc.).

Sets the stroke pattern as dots, dashes and gaps, like strokePattern(List) of the Maps SDK.

Link copied to clipboard

Sets the stroke width of the polygon outline in pixels.

Link copied to clipboard
fun tag(tag: Any?): PolygonOptions

Sets optional user data associated with the polygon.

Link copied to clipboard

Sets whether the polygon is visible.

Link copied to clipboard

Sets the z-index for draw order.