---
title: "Download map area by defining its bounding box - Kotlin SDK | Mobile sdk | Mobile sdk android | Android"
description: "Offline API allows you to download a rectangular area by defining its bounding box."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Download map area by defining its bounding box - Kotlin SDK

The MapTiler SDK for Kotlin provides a powerful Offline Pack API that allows you to download a rectangular area by defining its bounding box for use without an active internet connection.

Before you begin, ensure you have followed the [Android getting started with offline pack API](https://docs.maptiler.com/mobile-sdk/android/examples/offline-get-started/) to set up your project and obtain your API key.

## Basic Offline Pack (Bounding Box)

```kotlin
import com.maptiler.maptilersdk.offline.MTBoundingBox
import com.maptiler.maptilersdk.offline.MTOfflineManager
import com.maptiler.maptilersdk.offline.MTOfflineRegionDefinition
import com.maptiler.maptilersdk.offline.MTOfflineRegionGeometry
import com.maptiler.maptilersdk.map.style.MTMapReferenceStyle
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch

// Define the bounding box
val bounds = MTBoundingBox(
    minLon = 8.5170,
    minLat = 47.3500,
    maxLon = 8.5670,
    maxLat = 47.4000
)

// Create the region definition
val definition = MTOfflineRegionDefinition(
    geometry = MTOfflineRegionGeometry.BoundingBox(bounds),
    minZoom = 1,
    maxZoom = 12,
    referenceStyle = MTMapReferenceStyle.STREETS
)

// Create and download the pack
MainScope().launch {
    try {
        val pack = MTOfflineManager.createPack(context, definition)
        pack.download()
        println("Download started for pack: ${pack.id}")
    } catch (e: Exception) {
        e.printStackTrace()
    }
}
```

## Learn more

For more information browse our [API Reference](https://docs.maptiler.com/mobile-sdk/android/api/)

Check out our [SDK Kotlin Examples](https://docs.maptiler.com/mobile-sdk/android/examples/).
