# PlaceListMapTemplate

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/PlaceListMapTemplate.java+class:androidx.car.app.model.PlaceListMapTemplate) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class PlaceListMapTemplate implements Template
```

<br />

*** ** * ** ***

A template that displays a map along with a list of places.

The map can display markers corresponding to the places in the list. See `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setItemList(androidx.car.app.model.ItemList)` for details.

#### Template Restrictions

In regards to template refreshes, as described in `https://developer.android.com/reference/androidx/car/app/Screen#onGetTemplate()`, this template is considered a refresh of a previous one if:

- The previous template is in a loading state (see `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setLoading(boolean)`, or
- The template title has not changed, and the number of rows and the title (not counting spans) of each row between the previous and new `https://developer.android.com/reference/androidx/car/app/model/ItemList`s have not changed.
- The template is sent in response to a user-initiated content refresh request. (see `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setOnContentRefreshListener(androidx.car.app.model.OnContentRefreshListener)`.

## Summary

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#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/ActionStrip` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#getActionStrip()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/ActionStrip` for this template or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Place` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#getAnchor()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Place` instance to display as an anchor in the map. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Action` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#getHeaderAction()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Action` that is set to be displayed in the header of the template, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/ItemList` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#getItemList()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/ItemList` instance with the list of items to display in the template, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/OnContentRefreshDelegate` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 5) https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#getOnContentRefreshDelegate()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/OnContentRefreshDelegate` to be called when the user requests for content refresh for this template. |
| `@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/PlaceListMapTemplate#getTitle()()` Returns the title of the template or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#isCurrentLocationEnabled()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate#isLoading()()` Returns whether the template is loading. |
| `@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/PlaceListMapTemplate#toString()()` |

## Public methods

### equals

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

### getActionStrip

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

```
public @Nullable ActionStrip getActionStrip()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/ActionStrip` for this template or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setActionStrip(androidx.car.app.model.ActionStrip)` |   |

### getAnchor

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

```
public @Nullable Place getAnchor()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Place` instance to display as an anchor in the map.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setAnchor(androidx.car.app.model.Place)` |   |

### getHeaderAction

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

```
public @Nullable Action getHeaderAction()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Action` that is set to be displayed in the header of the template, or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setHeaderAction(androidx.car.app.model.Action)` |   |

### getItemList

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

```
public @Nullable ItemList getItemList()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/ItemList` instance with the list of items to display in the template, or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setItemList(androidx.car.app.model.ItemList)` |   |

### getOnContentRefreshDelegate

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

```
@RequiresCarApi(value = 5)
public @Nullable OnContentRefreshDelegate getOnContentRefreshDelegate()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/OnContentRefreshDelegate` to be called when the user requests for content refresh for this template.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setOnContentRefreshListener(androidx.car.app.model.OnContentRefreshListener)` |   |

### getTitle

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

```
public @Nullable CarText getTitle()
```

Returns the title of the template or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setTitle(java.lang.CharSequence)` |   |

### hashCode

```
public int hashCode()
```

### isCurrentLocationEnabled

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

```
public boolean isCurrentLocationEnabled()
```

### isLoading

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

```
public boolean isLoading()
```

Returns whether the template is loading.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/PlaceListMapTemplate.Builder#setLoading(boolean)` |   |

### toString

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