# PolygonOptions


```
public class PolygonOptions implements Parcelable
```

<br />

*** ** * ** ***

A representation of a polygon object in a 3D map.

## Summary

| ### Public fields |
|---|---|
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#altitudeMode()` |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#drawsOccludedSegments()` |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#extruded()` |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#fillColor()` |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#geodesic()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#id()` |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Hole>` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#innerPaths()` |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude>` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#path()` |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#strokeColor()` |
| `double` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#strokeWidth()` |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#zIndex()` |

| ### Public constructors |
|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#PolygonOptions()()` Default constructor for PolygonOptions. |
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#PolygonOptions(java.lang.String,java.util.List<com.google.android.gms.maps3d.model.LatLngAltitude>,java.util.List<com.google.android.gms.maps3d.model.Hole>,int,int,int,double,boolean,boolean,boolean,int)( https://developer.android.com/reference/java/lang/String.html id, https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude> path, https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Hole> innerPaths, @https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode, @https://developer.android.com/reference/androidx/annotation/ColorInt.html int fillColor, @https://developer.android.com/reference/androidx/annotation/ColorInt.html int strokeColor, double strokeWidth, boolean geodesic, boolean extruded, boolean drawsOccludedSegments, int zIndex )` Constructor for PolygonOptions with parameters for required fields. |

| ### Public methods |
|---|---|
| `int` | `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getAltitudeMode()()` Returns the altitude mode of the polygon. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getDrawsOccludedSegments()()` Returns whether the polygon draws occluded segments. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getExtruded()()` Returns whether the polygon is extruded. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getFillColor()()` Returns the fill color of the polygon in ARGB format. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getGeodesic()()` Returns whether the polygon is geodesic. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getId()()` Returns the ID of the polygon. |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Hole>` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getInnerPaths()()` Returns the inner coordinates of the polygon. |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude>` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getPath()()` Returns the outer coordinates of the polygon. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getStrokeColor()()` Returns the stroke color of the polygon in ARGB format. |
| `double` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getStrokeWidth()()` Returns the stroke width of the polygon. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#getZIndex()()` Returns the z-index of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setAltitudeMode(int)(@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode)` Sets the altitude mode of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setDrawsOccludedSegments(boolean)(boolean drawsOccludedSegments)` Sets whether the polygon draws occluded segments. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setExtruded(boolean)(boolean extruded)` Sets whether the polygon is extruded. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setFillColor(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt.html int fillColor)` Sets the fill color of the polygon in ARGB format. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setGeodesic(boolean)(boolean geodesic)` Sets whether the polygon is geodesic. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setId(java.lang.String)(https://developer.android.com/reference/java/lang/String.html id)` Sets the ID of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setInnerPaths(java.util.List<com.google.android.gms.maps3d.model.Hole>)(https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Hole> innerPaths)` Sets the inner coordinates of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setPath(java.util.List<com.google.android.gms.maps3d.model.LatLngAltitude>)(https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude> path)` Sets the outer coordinates of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setStrokeColor(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt.html int strokeColor)` Sets the stroke color of the polygon in ARGB format. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setStrokeWidth(double)(double strokeWidth)` Sets the stroke width of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#setZIndex(int)(int zIndex)` Sets the z-index of the polygon. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#writeToParcel(android.os.Parcel,int)(https://developer.android.com/reference/android/os/Parcel.html out, int flags)` |

| ### Extension functions |
|---|---|
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/ValidatorsKt.https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions#(com.google.android.gms.maps3d.model.PolygonOptions).validate()(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions receiver)` Validates a specified `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions` object. |

### Inherited Constants

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1` `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

### Inherited methods

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `abstract int` `https://developer.android.com/reference/android/os/Parcelable.html#describeContents()()`

## Public fields

### altitudeMode

```
public int altitudeMode
```

### drawsOccludedSegments

```
public boolean drawsOccludedSegments
```

### extruded

```
public boolean extruded
```

### fillColor

```
public @ColorInt int fillColor
```

### geodesic

```
public boolean geodesic
```

### id

```
public String id
```

### innerPaths

```
public List<Hole> innerPaths
```

### path

```
public List<LatLngAltitude> path
```

### strokeColor

```
public @ColorInt int strokeColor
```

### strokeWidth

```
public double strokeWidth
```

### zIndex

```
public int zIndex
```

## Public constructors

### PolygonOptions

```
public PolygonOptions()
```

Default constructor for PolygonOptions.

### PolygonOptions

```
public PolygonOptions(
    String id,
    List<LatLngAltitude> path,
    List<Hole> innerPaths,
    @AltitudeMode int altitudeMode,
    @ColorInt int fillColor,
    @ColorInt int strokeColor,
    double strokeWidth,
    boolean geodesic,
    boolean extruded,
    boolean drawsOccludedSegments,
    int zIndex
)
```

Constructor for PolygonOptions with parameters for required fields.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html id` | The unique identifier of the polygon. |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude> path` | The outer coordinates of the polygon. |
| `https://developer.android.com/reference/java/util/List.html<https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Hole> innerPaths` | The inner coordinates of the polygon. |
| `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode` | The altitude mode of the polygon. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int fillColor` | The fill color of the polygon. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt.html int strokeColor` | The stroke color of the polygon. |
| `double strokeWidth` | The stroke width of the polygon. |
| `boolean geodesic` | Whether the polygon is geodesic. |
| `boolean extruded` | Whether the polygon is extruded. |
| `boolean drawsOccludedSegments` | Whether the polygon draws occluded segments. |
| `int zIndex` | The z-index of the polygon. |

## Public methods

### getAltitudeMode

```
@AltitudeMode
public int getAltitudeMode()
```

Returns the altitude mode of the polygon.

### getDrawsOccludedSegments

```
public boolean getDrawsOccludedSegments()
```

Returns whether the polygon draws occluded segments.

### getExtruded

```
public boolean getExtruded()
```

Returns whether the polygon is extruded.

### getFillColor

```
public @ColorInt int getFillColor()
```

Returns the fill color of the polygon in ARGB format.

### getGeodesic

```
public boolean getGeodesic()
```

Returns whether the polygon is geodesic.

### getId

```
public String getId()
```

Returns the ID of the polygon.

### getInnerPaths

```
public List<Hole> getInnerPaths()
```

Returns the inner coordinates of the polygon.

### getPath

```
public List<LatLngAltitude> getPath()
```

Returns the outer coordinates of the polygon.

### getStrokeColor

```
public @ColorInt int getStrokeColor()
```

Returns the stroke color of the polygon in ARGB format.

### getStrokeWidth

```
public double getStrokeWidth()
```

Returns the stroke width of the polygon.

### getZIndex

```
public int getZIndex()
```

Returns the z-index of the polygon.

### setAltitudeMode

```
public void setAltitudeMode(@AltitudeMode int altitudeMode)
```

Sets the altitude mode of the polygon.

### setDrawsOccludedSegments

```
public void setDrawsOccludedSegments(boolean drawsOccludedSegments)
```

Sets whether the polygon draws occluded segments.

### setExtruded

```
public void setExtruded(boolean extruded)
```

Sets whether the polygon is extruded.

### setFillColor

```
public void setFillColor(@ColorInt int fillColor)
```

Sets the fill color of the polygon in ARGB format.

### setGeodesic

```
public void setGeodesic(boolean geodesic)
```

Sets whether the polygon is geodesic.

### setId

```
public void setId(String id)
```

Sets the ID of the polygon.

### setInnerPaths

```
public void setInnerPaths(List<Hole> innerPaths)
```

Sets the inner coordinates of the polygon.

### setPath

```
public void setPath(List<LatLngAltitude> path)
```

Sets the outer coordinates of the polygon.

### setStrokeColor

```
public void setStrokeColor(@ColorInt int strokeColor)
```

Sets the stroke color of the polygon in ARGB format.

### setStrokeWidth

```
public void setStrokeWidth(double strokeWidth)
```

Sets the stroke width of the polygon.

### setZIndex

```
public void setZIndex(int zIndex)
```

Sets the z-index of the polygon.

### writeToParcel

```
public void writeToParcel(Parcel out, int flags)
```

## Extension functions

### ValidatorsKt.validate

```
public final void ValidatorsKt.validate(@NonNull PolygonOptions receiver)
```

Validates a specified `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions` object.

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | if the `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/PolygonOptions` is not valid. |