# PlaceMarker

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/PlaceMarker.java+class:androidx.car.app.model.PlaceMarker) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class PlaceMarker
```

<br />

*** ** * ** ***

Describes how a place is to be displayed on a map.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/model/PlaceMarker.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker`. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#TYPE_ICON() = 0` Represents a marker icon. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#TYPE_IMAGE() = 1` Represents a marker image. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#getColor()()` Returns the marker color or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarIcon` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#getIcon()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/CarIcon` associated with this marker or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#getIconType()()` Returns the type of icon used with this marker. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#getLabel()()` Returns the text that should be rendered as the marker's content or `null` if one is not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#toString()()` |

## Constants

### TYPE_ICON

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int TYPE_ICON = 0
```

Represents a marker icon.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 64 x 64 dp bounding box. If necessary, the icon will be scaled down while preserving its aspect ratio.

A tint color is expected to be provided via `https://developer.android.com/reference/androidx/car/app/model/CarIcon.Builder#setTint(androidx.car.app.model.CarColor)`. Otherwise, a default tint color as determined by the host will be applied.

### TYPE_IMAGE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int TYPE_IMAGE = 1
```

Represents a marker image.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 72 x 72 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarColor getColor()
```

Returns the marker color or `null` if not set.

See `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker.Builder#setColor(androidx.car.app.model.CarColor)` on rules related to how the color is applied.

### getIcon

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarIcon getIcon()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/CarIcon` associated with this marker or `null` if not set.

### getIconType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public int getIconType()
```

Returns the type of icon used with this marker.

### getLabel

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarText getLabel()
```

Returns the text that should be rendered as the marker's content or `null` if one is not set.

Note that a `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker` can only display either an icon or a text label. If both are set, then `https://developer.android.com/reference/androidx/car/app/model/PlaceMarker#getIcon()` will take precedence.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```