# MapTemplate

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

*** ** * ** ***


```
@RequiresCarApi(value = 5)
@CarProtocol
public final class MapTemplate implements Template
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> with API 7. Use the `https://developer.android.com/reference/androidx/car/app/navigation/model/MapWithContentTemplate` API instead.

A template that displays a map with data such as `https://developer.android.com/reference/androidx/car/app/model/Pane` or `https://developer.android.com/reference/androidx/car/app/model/ItemList` on top of it.

#### 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 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/Pane`s or `https://developer.android.com/reference/androidx/car/app/model/ItemList`s have not changed.

For instance, using the deprecated `https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate`, if the template was:

```
MapTemplate.Builder builder = new MapTemplate.Builder()
         .setPane(paneBuilder.build())
         .setActionStrip(actionStrip)
         .setHeader(header)
         .setMapController(mapController)
         .build();
```
Using the new `https://developer.android.com/reference/androidx/car/app/navigation/model/MapWithContentTemplate`, the template would be:

```
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
           .setContentTemplate(new PaneTemplate.Builder(paneBuilder.build())
                  .setHeader(header)
                  .build())
           .setActionStrip(actionStrip)
           .setMapController(mapController)
           .build();
```

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `boolean` | `[equals](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#equals(java.lang.Object))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/ActionStrip` | `[getActionStrip](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getActionStrip())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Header` | `[getHeader](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getHeader())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/ItemList` | `[getItemList](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getItemList())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/navigation/model/MapController` | `[getMapController](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getMapController())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Pane` | `[getPane](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getPane())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[hashCode](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#hashCode())()` **This method is deprecated.** Deprecated in Java |

## Public methods

### equals

```
public boolean [equals](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#equals(java.lang.Object))(@Nullable Object other)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

### getActionStrip

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

```
public @Nullable ActionStrip [getActionStrip](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getActionStrip())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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/navigation/model/MapTemplate.Builder#setActionStrip(androidx.car.app.model.ActionStrip)` |   |

### getHeader

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

```
public @Nullable Header [getHeader](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getHeader())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/androidx/car/app/model/Header` to display in this template.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate.Builder#setHeader(androidx.car.app.model.Header)` |   |

### getItemList

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

```
public @Nullable ItemList [getItemList](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getItemList())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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/navigation/model/MapTemplate.Builder#setItemList(androidx.car.app.model.ItemList)` |   |

### getMapController

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

```
public @Nullable MapController [getMapController](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getMapController())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the controls associated with an app-provided map.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate.Builder#setMapController(androidx.car.app.navigation.model.MapController)` |   |

### getPane

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

```
public @Nullable Pane [getPane](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#getPane())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/androidx/car/app/model/Pane` to display in this template.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate.Builder#setPane(androidx.car.app.model.Pane)` |   |

### hashCode

```
public int [hashCode](https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate#hashCode())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java