# Introduction

This package provides the ability to download areas of maps, known as 'regions' throughout this documentation. There are built in region shapes that even large apps, such as Google Maps, don't have!

Downloading is extremely efficient and fast, and uses multiple threads and isolates to achieve write speeds of hundreds of tiles per second (if the network/server speed allows).

After downloading, tiles are stored in the same place as when Browse Caching, meaning that no extra setup is needed to use them in a map (other than the usual [flutter\_map Integration](/v8/usage/integration.md)).

{% hint style="warning" %}
Before using FMTC, ensure you comply with the appropriate rules and ToS set by your tile server. Failure to do so may lead to a permenant ban, or any other punishment.

This library and/or the creator(s) are not responsible for any violations you make using this package.

OpenStreetMap's can be [found here](https://operations.osmfoundation.org/policies/tiles): specifically bulk downloading is discouraged, and forbidden after zoom level 13. Other servers may have different terms.
{% endhint %}

## 4 Steps To Downloading

1. [Create a region based on the user's input](/v8/bulk-downloading/regions.md)
2. [Convert that region into a downloadable region](/v8/bulk-downloading/prepare.md)
3. Start downloading that region, either in the [foreground](/v8/bulk-downloading/foreground.md) or [background](/v8/bulk-downloading/background.md)
4. [Listen for progress events to update your user](/v8/bulk-downloading/foreground/progress.md)

## Available APIs

All APIs listed in this section are children of the `download` getter.

<table><thead><tr><th width="238">API Member</th><th>Explanation</th></tr></thead><tbody><tr><td><a href="/pages/tkW40lqI0f14YpAXkgO0"><code>startForeground()</code></a></td><td>Start a download in the foreground</td></tr><tr><td><a href="/pages/qK0PQ7EoofYzAS1seUzz"><code>startBackground()</code></a></td><td>Start a download in the background</td></tr><tr><td><a href="/pages/z6CsHSz41ooUzs1UzOxf#checking-number-of-tiles"><code>check()</code></a></td><td>Check the number of tiles in a certain region</td></tr><tr><td><a href="/pages/nbxvKQQvLenaVe8V3Y8W"><code>cancel()</code></a></td><td>Cancel any ongoing downloads</td></tr></tbody></table>

## Recovery

The recovery system is designed to support bulk downloading, and provide some form of recovery if the download fails unexpectedly - this might happen if the app crashes, for example.

Read more about the recovery system here:

{% content-ref url="/pages/QjStFkRCKXgLWD1lY19Q" %}
[Recovery](/v8/usage/roots-and-stores/recovery.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fmtc.jaffaketchup.dev/v8/bulk-downloading/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
