Source: https://developers.woosmap.com/products/mobile/android/indoor-direction/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Indoor Direction



This guide will show you different ways to leverage Woosmap Indoor in your Android application.

This guide assume you already know how to add the SDK as a dependency and configure an API Key.  
If you never used Woosmap Android SDK before, we strongly recommend to start with the [Step by Step Guide](/products/mobile/android/step-by-step-first-application/) first.

This guide also assume you already have an indoor venue prepared in your project.

## Adding an IndoorRenderer

To display an Indoor Venue you simply need to instantiate a `IndoorRenderer`:

```kotlin
val indoorRenderer = IndoorRenderer(mapView, "my_venue", theme = "optional_theme_for_icons") { venue ->
    venue.levels?.forEach { level -> 
        //... 
    } 
} 
```

As you can see the constructor also provides an optional callback once the venue details is loaded, the primary usage for it is to set up your own customized level selector.
You can add a level changed listener using `addOnLevelChanged()` and tell the renderer to change the currently displayed level using the `currentLevel` property.
The default level selector can be simply disabled with:

```kotlin
mapView.setUiSettings {
    isLevelSelectorEnabled = false
}
```

## Indoor direction service

Woosmap Indoor API provides you tools to create an optimized navigation experience:
- Indoor turn-by-turn navigation with Points of Interest
- Routing based on mobility profiles (Handicapped access, travelling with a buggy, walking, etc.)
- Multilingual

Use the IndoorService class to calculate the shortest route between 2 locations (`IndoorService().directions()`) and display the route on the map thanks to the `plotRoute()` method of the IndoorRenderer.

8 parameters are available to provide a suitable navigation experience to your user:

| Field       | Type    | Mandatory | Default | Description                                                                                                                                          |
|-------------|---------|-----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| venueId     | String  | X         |         | Id of the Venue                                                                                                                                      |
| origin      | String  | X         |         | A string with the format lat,lng,level or poi_id (identifier of a POI) or ref:poi_ref (ref of a poi with starting with 'ref:')                       |
| destination | String  | X         |         | A string with the format lat,lng,level or poi_id (identifier of a poi) or ref:poi_ref (ref of a poi with starting with 'ref:')                       |
| language    | String  |           | en      | Language for instructions                                                                                                                            |
| units       | String  |           | metric  | Distance value unit                                                                                                                                  |
| mode        | String  |           | null    | Routing profile for using suitable path only                                                                                                         |
| avoid       | String  |           | null    | Exclude one/multiple zone from the walkbale network of the venue, expected zone format `level;lat,lng;lat,lng; ... ;lat,lng`                         |
| waypoints   | String  |           | null    | A list of points by which the route should pass. Ex: lat,lng,level&#x7c;poi_id&#x7c;lat,lng,level&#x7c;ref:poi_ref                                   |
| optimize    | Boolean |           | false   | You may set it to true with the waypoints parameter. This way the provided route is optimized by rearranging the waypoints in a more efficient order |

Here is a code sample:

On a background thread:

```kotlin
const indoorService = new window.woosmap.map.IndoorService();
val indoorService = IndoorService()
val directionResponse = indoorService.directions(
    venue_id = "my_venue",
    origin = "${x.latitude},${x.longitude},0",
    destination = "${y.latitude},${y.longitude},0",
    language = "en",
    units = "metric",
    mode = "wheelchair"
)
```

then on the UI thread:

```kotlin
indoorService.plotRoute(directionResponse.routes[0])
```

* [Android SDK API Reference Documentation](https://native-sdk.woosmap.com/android/doc/latest/)

![Woosmap Demo Screenshot](/assets/images/mobile/android/indoor-directions/indoor-directions.png){:style="display:block; margin-left:auto; margin-right:auto; width: 300px;"}
