---
title: "MTOfflineRegionDefinition | Mobile sdk | Mobile sdk ios | Ios"
description: "Defines a region for offline download."
---

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

# MTOfflineRegionDefinition

```
public struct MTOfflineRegionDefinition : Codable, Equatable, Sendable
```

Defines a region for offline download.

-   `[geometry](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV8geometryAA0dE8GeometryOvp)`
    
    The geometry of the region.
    
    #### Declaration
    
    Swift
    
    ```
    public let geometry: MTOfflineRegionGeometry
    ```
    
-   `[minZoom](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV7minZoomSivp)`
    
    The minimum zoom level.
    
    Note
    
    This defines the data fetched from the server, _not_ the camera’s zoom limit. If you download a very small geographic area (e.g., a single neighborhood) and set `minZoom` to 0, the map camera may still prevent the user from zooming out to 0 when loading the pack. This is because the camera is physically constrained by the bounding box of the downloaded data to prevent the user from panning into “blank” map areas. The apparent minimum zoom is dictated by the screen size relative to the bounding box.
    
    #### Declaration
    
    Swift
    
    ```
    public let minZoom: Int
    ```
    
-   `[maxZoom](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV7maxZoomSivp)`
    
    The maximum zoom level.
    
    Higher zoom levels provide street-level detail but exponentially increase the storage size.
    
    Note
    
    If you request a `maxZoom` that exceeds the source’s maximum available zoom (e.g., requesting zoom 18 for MapTiler Planet vector tiles which end at zoom 14), the SDK will automatically download the highest available resolution (zoom 14) for that area. This ensures that the map engine can perform client-side “overzooming” to render the requested detail level offline.
    
    #### Declaration
    
    Swift
    
    ```
    public let maxZoom: Int
    ```
    
-   `[referenceStyle](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV14referenceStyleAA014MTMapReferenceH0Ovp)`
    
    The reference style for the map.
    
    #### Declaration
    
    Swift
    
    ```
    public let referenceStyle: MTMapReferenceStyle
    ```
    
-   `[styleVariant](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV12styleVariantAA010MTMapStyleH0OSgvp)`
    
    The optional style variant.
    
    #### Declaration
    
    Swift
    
    ```
    public let styleVariant: MTMapStyleVariant?
    ```
    
-   `[pixelRatio](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV10pixelRatioSfvp)`
    
    The device pixel ratio.
    
    #### Declaration
    
    Swift
    
    ```
    public let pixelRatio: Float
    ```
    
-   `[maxTileCount](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV12maxTileCountSiSgvp)`
    
    The maximum number of tiles allowed for this region.
    
    #### Declaration
    
    Swift
    
    ```
    public let maxTileCount: Int?
    ```
    
-   `[padding](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV7paddingSdSgvp)`
    
    An optional buffer in meters to add around the geometry for map interaction and tile fetching. If not explicitly provided, a default heuristic buffer (~2000m) may be applied for flexible geometries (routes and polygons).
    
    #### Declaration
    
    Swift
    
    ```
    public let padding: Double?
    ```
    
-   `[bbox](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV4bboxAA13MTBoundingBoxVvp)`
    
    The bounding box of the region.
    
    #### Declaration
    
    Swift
    
    ```
    public var bbox: MTBoundingBox { get }
    ```
    
-   `[init(geometry:minZoom:maxZoom:referenceStyle:styleVariant:pixelRatio:maxTileCount:padding:)](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV8geometry7minZoom03maxI014referenceStyle12styleVariant10pixelRatio0J9TileCount7paddingAcA0dE8GeometryO_S2iAA014MTMapReferenceL0OAA0ulN0OSgSfSiSgSdSgtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        geometry: MTOfflineRegionGeometry,
        minZoom: Int,
        maxZoom: Int,
        referenceStyle: MTMapReferenceStyle,
        styleVariant: MTMapStyleVariant? = nil,
        pixelRatio: Float = 1.0,
        maxTileCount: Int? = nil,
        padding: Double? = nil
    )
    ```
    
-   `[init(bbox:minZoom:maxZoom:referenceStyle:styleVariant:pixelRatio:maxTileCount:padding:)](#/s:11MapTilerSDK25MTOfflineRegionDefinitionV4bbox7minZoom03maxI014referenceStyle12styleVariant10pixelRatio0J9TileCount7paddingAcA13MTBoundingBoxV_S2iAA014MTMapReferenceL0OAA0vlN0OSgSfSiSgSdSgtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        bbox: MTBoundingBox,
        minZoom: Int,
        maxZoom: Int,
        referenceStyle: MTMapReferenceStyle,
        styleVariant: MTMapStyleVariant? = nil,
        pixelRatio: Float = 1.0,
        maxTileCount: Int? = nil,
        padding: Double? = nil
    )
    ```
    
-   `[init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`
    
    #### Declaration
    
    Swift
    
    ```
    public init(from decoder: Decoder) throws
    ```
    
-   `[encode(to:)](#/s:SE6encode2toys7Encoder_p_tKF)`
    
    #### Declaration
    
    Swift
    
    ```
    public func encode(to encoder: Encoder) throws
    ```
