# Marker


```
public class Marker implements Anchorable
```

<br />

*** ** * ** ***

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

## Summary

| ### 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/Marker#getAltitudeMode()()` Returns 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/Marker#getCollisionBehavior()()` Returns the collision behavior of the marker. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#getCollisionPriority()()` Returns the collision priority of the marker. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#getDrawsWhenOccluded()()` Returns whether the marker is drawn when occluded. |
| `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/Marker#getId()()` Returns the id 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/Marker#getLabel()()` Returns 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/Marker#getPosition()()` Returns the position of the marker. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#getSizePreserved()()` Returns whether the marker size is preserved. |
| `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/Marker#getUrl()()` Returns the url of the image to use for the marker. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#getZIndex()()` Returns the zIndex of the marker. |
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#isExtruded()()` Returns whether the marker is extruded. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#remove()()` Removes this marker from the 3d map. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#setAltitudeMode(int)(@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int value)` 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/Marker#setClickListener(com.google.android.gms.maps3d.OnMarkerClickListener)(@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/OnMarkerClickListener listener)` Sets the click listener that will be invoked when this marker is clicked. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#setCollisionBehavior(int)(@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/CollisionBehavior int value)` 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/Marker#setCollisionPriority(int)(int value)` 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/Marker#setDrawsWhenOccluded(boolean)(boolean value)` 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/Marker#setExtruded(boolean)(boolean value)` Sets whether the marker is extruded. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#setLabel(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/String.html value)` Sets the label of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#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 value)` Sets the position of the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#setSizePreserved(boolean)(boolean value)` 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/Marker#setUrl(java.lang.String)(https://developer.android.com/reference/java/lang/String.html value)` Sets the url of the image to use for the marker. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Marker#setZIndex(int)(int value)` Sets the zIndex of the marker. |

## Public methods

### getAltitudeMode

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

Returns the altitude mode of the marker.

### getCollisionBehavior

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

Returns the collision behavior of the marker.

### getCollisionPriority

```
public int getCollisionPriority()
```

Returns the collision priority of the marker.

### getDrawsWhenOccluded

```
public boolean getDrawsWhenOccluded()
```

Returns whether the marker is drawn when occluded.

### getId

```
public String getId()
```

Returns the id of the marker.

### getLabel

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

Returns the label of the marker.

### getPosition

```
public LatLngAltitude getPosition()
```

Returns the position of the marker.

### getSizePreserved

```
public boolean getSizePreserved()
```

Returns whether the marker size is preserved.

### getUrl

```
public String getUrl()
```

Returns the url of the image to use for the marker.

### getZIndex

```
public int getZIndex()
```

Returns the zIndex of the marker.

### isExtruded

```
public boolean isExtruded()
```

Returns whether the marker is extruded.

### remove

```
public void remove()
```

Removes this marker from the 3d map.

### setAltitudeMode

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

Sets the altitude mode of the marker.

### setClickListener

```
public void setClickListener(@Nullable OnMarkerClickListener listener)
```

Sets the click listener that will be invoked when this marker is clicked.

| Parameters |
|---|---|
| `@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/OnMarkerClickListener listener` | The click listener to set. |

### setCollisionBehavior

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

Sets the collision behavior of the marker.

### setCollisionPriority

```
public void setCollisionPriority(int value)
```

Sets the collision priority of the marker.

| Parameters |
|---|---|
| `int value` | The collision priority to set. |

### setDrawsWhenOccluded

```
public void setDrawsWhenOccluded(boolean value)
```

Sets whether the marker is drawn when occluded.

### setExtruded

```
public void setExtruded(boolean value)
```

Sets whether the marker is extruded.

### setLabel

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

Sets the label of the marker.

### setPosition

```
public void setPosition(LatLngAltitude value)
```

Sets the position of the marker.

### setSizePreserved

```
public void setSizePreserved(boolean value)
```

Sets whether the marker size is preserved.

### setUrl

```
public void setUrl(String value)
```

Sets the url of the image to use for the marker.

### setZIndex

```
public void setZIndex(int value)
```

Sets the zIndex of the marker.