# 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
class MapTemplate : Template
```

<br />

*** ** * ** ***

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

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

#### Template Restrictions

In regards to template refreshes, as described in `https://developer.android.com/reference/kotlin/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/kotlin/androidx/car/app/model/Pane`s or `https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList`s have not changed.

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

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

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

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#equals(java.lang.Object))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/ActionStrip?` | `[getActionStrip](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getActionStrip())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Header?` | `[getHeader](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getHeader())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList?` | `[getItemList](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getItemList())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapController?` | `[getMapController](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getMapController())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Pane?` | `[getPane](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getPane())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#hashCode())()` **This function is deprecated.** Deprecated in Java |

## Public functions

### equals

```
fun [equals](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#equals(java.lang.Object))(other: Any?): Boolean
```

> [!CAUTION]
> **This function 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)

```
fun [getActionStrip](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getActionStrip())(): ActionStrip?
```

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

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun [getHeader](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getHeader())(): Header?
```

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

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun [getItemList](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getItemList())(): ItemList?
```

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

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

```
fun [getMapController](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getMapController())(): MapController?
```

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

Returns the controls associated with an app-provided map.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun [getPane](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate#getPane())(): Pane?
```

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

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

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

### hashCode

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

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