# PlaceMarker

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/PlaceMarker "View this page in Java")

<br />

```
@CarProtocol
class PlaceMarker
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                            ### Nested types                                                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[PlaceMarker.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker.Builder) A builder of[PlaceMarker](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker). |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TYPE_ICON](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#TYPE_ICON())` = 0` Represents a marker icon.    |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TYPE_IMAGE](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#TYPE_IMAGE())` = 1` Represents a marker image. |

|                                     ### Public functions                                      |
|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)           | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                 |
| [CarColor](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor)`?` | [getColor](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#getColor())`()` Returns the marker color or`null`if not set.                                                                                                     |
| [CarIcon](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon)`?`   | [getIcon](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#getIcon())`()` Returns the[CarIcon](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon)associated with this marker or`null`if not set. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                   | [getIconType](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#getIconType())`()` Returns the type of icon used with this marker.                                                                                            |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`   | [getLabel](https://developer.android.com/reference/kotlin/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://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                   | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/model/PlaceMarker#hashCode())`()`                                                                                                                                                  |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)             | [toString](https://developer.android.com/reference/kotlin/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)  

```
const val TYPE_ICON = 0: Int
```

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[setTint](https://developer.android.com/reference/kotlin/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)  

```
const val TYPE_IMAGE = 1: Int
```

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 functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getColor

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

```
fun getColor(): CarColor?
```

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

See[setColor](https://developer.android.com/reference/kotlin/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)  

```
fun getIcon(): CarIcon?
```

Returns the[CarIcon](https://developer.android.com/reference/kotlin/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)  

```
fun getIconType(): Int
```

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)  

```
fun getLabel(): CarText?
```

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

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

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String
```