---
title: "TilePreloadOptions | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> 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.

# Type Alias TilePreloadOptions

Options shared by all tile preloading APIs.

#### Remarks[](#remarks)

**API Key Usage**: Tile preloading issues one network request per tile per active source. These requests count against your MapTiler Cloud API key quota. Use `onProgress` to monitor consumption and prefer narrow zoom ranges and small bounds where possible.

type TilePreloadOptions \= {  
    [maxTiles](#maxtiles)?: number;  
    [onError](#onerror)?: [TilePreloadErrorCallback](https://docs.maptiler.com/sdk-js/api-reference/types/TilePreloadErrorCallback/);  
    [onProgress](#onprogress)?: [TilePreloadProgressCallback](https://docs.maptiler.com/sdk-js/api-reference/types/TilePreloadProgressCallback/);  
}

##### Index

### Properties[](#properties)

[maxTiles?](#maxtiles) [onError?](#onerror) [onProgress?](#onprogress)

## Properties[](#properties-1)

### `Optional`maxTiles[](#maxtiles)

maxTiles?: number

Maximum number of tiles to fetch across all sources. Tiles beyond this limit are silently dropped. Defaults to `512`.

#### Remarks[](#remarks-1)

**API Key Usage**: Each tile counts against your MapTiler Cloud API key quota. Keep this value conservative, especially across wide zoom ranges.

#### Default Value[](#default-value)

```typescript
512
```

### `Optional`onError[](#onerror)

onError?: [TilePreloadErrorCallback](https://docs.maptiler.com/sdk-js/api-reference/types/TilePreloadErrorCallback/)

Called when a tile fails to load.

### `Optional`onProgress[](#onprogress)

onProgress?: [TilePreloadProgressCallback](https://docs.maptiler.com/sdk-js/api-reference/types/TilePreloadProgressCallback/)

Called after each tile fetch attempt, whether it succeeded or failed.
