---
title: "MTOfflineZoomRange | Mobile sdk | Mobile sdk ios | Ios"
description: "Defines and validates a zoom range for offline tile calculations."
---

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

# MTOfflineZoomRange

```
public struct MTOfflineZoomRange : Equatable
```

Defines and validates a zoom range for offline tile calculations.

-   `[minZoom](#/s:11MapTilerSDK18MTOfflineZoomRangeV03minE0Sivp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let minZoom: Int
    ```
    
-   `[maxZoom](#/s:11MapTilerSDK18MTOfflineZoomRangeV03maxE0Sivp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let maxZoom: Int
    ```
    
-   `[init(minZoom:maxZoom:)](#/s:11MapTilerSDK18MTOfflineZoomRangeV03minE003maxE0ACSi_SitKcfc)`
    
    Initializes a zoom range.
    
    Throws
    
    `[MTOfflineCoverageInputError](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTOfflineCoverageInputError/)` if zoom levels are negative or if minZoom > maxZoom. Note: Zoom levels greater than 22 are clamped to 22.
    
    #### Declaration
    
    Swift
    
    ```
    public init(minZoom: Int, maxZoom: Int) throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>minZoom</em></code></td><td><div><p>The minimum zoom level. Must be &gt;= 0.</p></div></td></tr><tr><td><code><em>maxZoom</em></code></td><td><div><p>The maximum zoom level. Must be &gt;= 0 and &gt;= minZoom.</p></div></td></tr></tbody></table>
    
-   `[clamped(toSourceMin:sourceMax:)](#/s:11MapTilerSDK18MTOfflineZoomRangeV7clamped11toSourceMin9sourceMaxACSgSi_SitF)`
    
    Clamps the zoom range to the limits provided by a source (e.g., from TileJSON).
    
    #### Declaration
    
    Swift
    
    ```
    public func clamped(toSourceMin sourceMin: Int, sourceMax: Int) -> MTOfflineZoomRange?
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>sourceMin</em></code></td><td><div><p>The minimum zoom level supported by the source.</p></div></td></tr><tr><td><code><em>sourceMax</em></code></td><td><div><p>The maximum zoom level supported by the source.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A new `MTOfflineZoomRange` clamped to the source limits, or `nil` if the requested range falls completely outside the source limits (e.g., requesting zoom 12-14 from a source that only provides 0-10).
