# MarkerOptions


```
public class MarkerOptions implements Parcelable
```

<br />

*** ** * ** ***

Defines options for a 3D marker.

## Summary

| ### Public fields |
|---|---|
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#altitudeMode()` |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#collisionBehavior()` |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#collisionPriority()` |
| `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/MarkerOptions#id()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html 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/MarkerOptions#label()` |
| `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/MarkerOptions#position()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerStyle` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#style()` |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#zIndex()` |

| ### Public constructors |
|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#MarkerOptions()()` Default constructor for MarkerOptions. |

| ### 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/MarkerOptions#getAltitudeMode()()` The altitude mode of the marker. |
| `int` | `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/CollisionBehavior https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#getCollisionBehavior()()` The collision behavior of the marker. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#getCollisionPriority()()` The collision priority of the marker. |
| `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/MarkerOptions#getId()()` The unique identifier of the marker. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html 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/MarkerOptions#getLabel()()` The label of the marker. |
| `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/MarkerOptions#getPosition()()` The position of the marker. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerStyle` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#getStyle()()` Returns the MarkerStyle class that contains ImageView\|PinConfiguration with relevant details to render the entire marker contents. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#getZIndex()()` The zIndex of the marker. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#isDrawnWhenOccluded()()` Whether the marker is drawn when occluded. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#isExtruded()()` Whether the marker is extruded. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#isSizePreserved()()` Whether the marker size is preserved. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#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 marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setCollisionBehavior(int)(@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/CollisionBehavior int collisionBehavior)` Sets the collision behavior of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setCollisionPriority(int)(int collisionPriority)` Sets the collision priority of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setDrawnWhenOccluded(boolean)(boolean drawnWhenOccluded)` Sets whether the marker is drawn when occluded. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setExtruded(boolean)(boolean extruded)` Sets whether the marker is extruded. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setId(java.lang.String)(https://developer.android.com/reference/java/lang/String.html id)` Sets the unique identifier of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setLabel(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/String.html label)` Sets the label of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setPosition(com.google.android.gms.maps3d.model.LatLngAltitude)(https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude position)` Sets the position of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setSizePreserved(boolean)(boolean sizePreserved)` Sets whether the marker size is preserved. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setStyle(com.google.android.gms.maps3d.model.ImageView)(@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/ImageView image)` Sets the ImageView (png image contents of the entire marker) to draw the image to render the entire marker contents. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setStyle(com.google.android.gms.maps3d.model.PinConfiguration)(@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/PinConfiguration pinConfig)` Sets the PinConfiguration with relevant details to render the entire marker contents. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#setZIndex(int)(int zIndex)` Sets the zIndex of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions#writeToParcel(android.os.Parcel,int)(https://developer.android.com/reference/android/os/Parcel.html dest, 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/MarkerOptions#(com.google.android.gms.maps3d.model.MarkerOptions).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/MarkerOptions receiver)` Validates a specified `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions` 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
```

### collisionBehavior

```
public int collisionBehavior
```

### collisionPriority

```
public int collisionPriority
```

### id

```
public String id
```

### label

```
public @Nullable String label
```

### position

```
public LatLngAltitude position
```

### style

```
public @Nullable MarkerStyle style
```

### zIndex

```
public int zIndex
```

## Public constructors

### MarkerOptions

```
public MarkerOptions()
```

Default constructor for MarkerOptions.

## Public methods

### getAltitudeMode

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

The altitude mode of the marker.

### getCollisionBehavior

```
@CollisionBehavior
public int getCollisionBehavior()
```

The collision behavior of the marker.

### getCollisionPriority

```
public int getCollisionPriority()
```

The collision priority of the marker.

### getId

```
public String getId()
```

The unique identifier of the marker.

### getLabel

```
public @Nullable String getLabel()
```

The label of the marker.

### getPosition

```
public LatLngAltitude getPosition()
```

The position of the marker.

### getStyle

```
public @Nullable MarkerStyle getStyle()
```

Returns the MarkerStyle class that contains ImageView\|PinConfiguration with relevant details to render the entire marker contents.

### getZIndex

```
public int getZIndex()
```

The zIndex of the marker.

### isDrawnWhenOccluded

```
public boolean isDrawnWhenOccluded()
```

Whether the marker is drawn when occluded.

### isExtruded

```
public boolean isExtruded()
```

Whether the marker is extruded.

### isSizePreserved

```
public boolean isSizePreserved()
```

Whether the marker size is preserved.

### setAltitudeMode

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

Sets the altitude mode of the marker.

### setCollisionBehavior

```
public void setCollisionBehavior(@CollisionBehavior int collisionBehavior)
```

Sets the collision behavior of the marker.

### setCollisionPriority

```
public void setCollisionPriority(int collisionPriority)
```

Sets the collision priority of the marker.

| Parameters |
|---|---|
| `int collisionPriority` | The collision priority of the marker. |

### setDrawnWhenOccluded

```
public void setDrawnWhenOccluded(boolean drawnWhenOccluded)
```

Sets whether the marker is drawn when occluded.

### setExtruded

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

Sets whether the marker is extruded.

### setId

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

Sets the unique identifier of the marker.

### setLabel

```
public void setLabel(@Nullable String label)
```

Sets the label of the marker.

### setPosition

```
public void setPosition(LatLngAltitude position)
```

Sets the position of the marker.

### setSizePreserved

```
public void setSizePreserved(boolean sizePreserved)
```

Sets whether the marker size is preserved.

### setStyle

```
public void setStyle(@NonNull ImageView image)
```

Sets the ImageView (png image contents of the entire marker) to draw the image to render the entire marker contents. Replaces/overwrites previous marker content.

### setStyle

```
public void setStyle(@NonNull PinConfiguration pinConfig)
```

Sets the PinConfiguration with relevant details to render the entire marker contents. Replaces/overwrites previous marker content.

### setZIndex

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

Sets the zIndex of the marker.

### writeToParcel

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

## Extension functions

### ValidatorsKt.validate

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

Validates a specified `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/MarkerOptions` 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/MarkerOptions` is not valid. |