---
title: "MTBoundingBox | Mobile sdk | Mobile sdk ios | Ios"
description: "A bounding box in WGS84 coordinates."
---

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

# MTBoundingBox

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

A bounding box in WGS84 coordinates.

-   `[minLon](#/s:11MapTilerSDK13MTBoundingBoxV6minLonSdvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let minLon: Double
    ```
    
-   `[minLat](#/s:11MapTilerSDK13MTBoundingBoxV6minLatSdvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let minLat: Double
    ```
    
-   `[maxLon](#/s:11MapTilerSDK13MTBoundingBoxV6maxLonSdvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let maxLon: Double
    ```
    
-   `[maxLat](#/s:11MapTilerSDK13MTBoundingBoxV6maxLatSdvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public let maxLat: Double
    ```
    
-   `[crossesAntimeridian](#/s:11MapTilerSDK13MTBoundingBoxV19crossesAntimeridianSbvp)`
    
    Returns `true` if the bounding box spans across the antimeridian (180th meridian).
    
    #### Declaration
    
    Swift
    
    ```
    public var crossesAntimeridian: Bool { get }
    ```
    
-   `[init(minLon:minLat:maxLon:maxLat:)](#/s:11MapTilerSDK13MTBoundingBoxV6minLon0F3Lat03maxG00iH0ACSd_S3dtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(minLon: Double, minLat: Double, maxLon: Double, maxLat: Double)
    ```
    
-   `[intersects(with:)](#/s:11MapTilerSDK13MTBoundingBoxV10intersects4withSbAC_tF)`
    
    Checks if this bounding box intersects with another bounding box.
    
    #### Declaration
    
    Swift
    
    ```
    public func intersects(with other: MTBoundingBox) -> Bool
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>other</em></code></td><td><div><p>The other bounding box to check against.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    `true` if the bounding boxes intersect, otherwise `false`.
    

[](#/Normalization%20%26%20Dateline%20Splitting)

### Normalization & Dateline Splitting

-   `[maxWebMercatorLat](#/s:11MapTilerSDK13MTBoundingBoxV17maxWebMercatorLatSdvpZ)`
    
    The maximum latitude limit for Web Mercator projection.
    
    #### Declaration
    
    Swift
    
    ```
    public static let maxWebMercatorLat: Double
    ```
    
-   `[normalizeLongitude(_:)](#/s:11MapTilerSDK13MTBoundingBoxV18normalizeLongitudeyS2dFZ)`
    
    Normalizes a longitude to the standard range \[-180, 180\].
    
    #### Declaration
    
    Swift
    
    ```
    public static func normalizeLongitude(_ longitude: Double) -> Double
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>longitude</em></code></td><td><div><p>The raw longitude.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A normalized longitude.
    
-   `[clampLatitude(_:)](#/s:11MapTilerSDK13MTBoundingBoxV13clampLatitudeyS2dFZ)`
    
    Clamps a latitude to the Web Mercator valid range (-85.0511… to 85.0511…).
    
    #### Declaration
    
    Swift
    
    ```
    public static func clampLatitude(_ latitude: Double) -> Double
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>latitude</em></code></td><td><div><p>The raw latitude.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A clamped latitude.
    
-   `[normalizedAndSplit()](#/s:11MapTilerSDK13MTBoundingBoxV18normalizedAndSplitSayACGyF)`
    
    Normalizes the bounding box coordinates and splits it into two if it crosses the antimeridian (Dateline).
    
    #### Declaration
    
    Swift
    
    ```
    public func normalizedAndSplit() -> [MTBoundingBox]
    ```
    
    #### Return Value
    
    An array containing one normalized bounding box, or two if it crosses the antimeridian.
    

[](#/Interoperability%20%26%20Helper%20Utilities)

### Interoperability & Helper Utilities

-   `[init(bounds:)](#/s:11MapTilerSDK13MTBoundingBoxV6boundsAcA8MTBoundsV_tcfc)`
    
    Initializes a bounding box from an `[MTBounds](https://docs.maptiler.com/mobile-sdk/ios/api/Structs/MTBounds/)` instance.
    
    #### Declaration
    
    Swift
    
    ```
    public init(bounds: MTBounds)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>bounds</em></code></td><td><div><p>The source <code><a href="https://docs.maptiler.com/mobile-sdk/ios/api/Structs/MTBounds/">MTBounds</a></code>.</p></div></td></tr></tbody></table>
    
-   `[init(coordinates:)](#/s:11MapTilerSDK13MTBoundingBoxV11coordinatesACSgSaySo22CLLocationCoordinate2DVG_tcfc)`
    
    Creates a bounding box from an array of coordinates.
    
    #### Declaration
    
    Swift
    
    ```
    public init?(coordinates: [CLLocationCoordinate2D])
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>An array of coordinates (e.g. forming a polygon or line).</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A bounding box enclosing all coordinates, or nil if the array is empty.
    
-   `[bounds](#/s:11MapTilerSDK13MTBoundingBoxV6boundsAA8MTBoundsVvp)`
    
    Returns an equivalent `[MTBounds](https://docs.maptiler.com/mobile-sdk/ios/api/Structs/MTBounds/)` instance.
    
    #### Declaration
    
    Swift
    
    ```
    public var bounds: MTBounds { get }
    ```
    
-   `[expanded(byMeters:)](#/s:11MapTilerSDK13MTBoundingBoxV8expanded8byMetersACSd_tF)`
    
    Expands the bounding box outward by a given distance in meters.
    
    #### Declaration
    
    Swift
    
    ```
    public func expanded(byMeters meters: Double) -> MTBoundingBox
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>meters</em></code></td><td><div><p>The distance in meters to expand.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A new expanded bounding box.
    
-   `[expanded(by:)](#/s:11MapTilerSDK13MTBoundingBoxV8expanded2byACSd_tF)`
    
    Expands the bounding box outward by a given percentage.
    
    #### Declaration
    
    Swift
    
    ```
    public func expanded(by percentage: Double) -> MTBoundingBox
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>percentage</em></code></td><td><div><p>The percentage to expand (e.g., 0.1 for a 10% buffer).</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A new expanded bounding box.
    
-   `[areaInSquareKilometers](#/s:11MapTilerSDK13MTBoundingBoxV22areaInSquareKilometersSdvp)`
    
    Calculates the approximate surface area in square kilometers.
    
    #### Declaration
    
    Swift
    
    ```
    public var areaInSquareKilometers: Double { get }
    ```
    
-   `[estimatedTileCount(zoomRange:)](#/s:11MapTilerSDK13MTBoundingBoxV18estimatedTileCount9zoomRangeSiAA013MTOfflineZoomJ0V_tF)`
    
    Estimates the exact number of tiles required for this bounding box within the specified zoom range.
    
    #### Declaration
    
    Swift
    
    ```
    public func estimatedTileCount(zoomRange: MTOfflineZoomRange) -> Int
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>zoomRange</em></code></td><td><div><p>The min and max zoom levels.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    The total tile count.
    
-   `[estimatedTileCountPerZoom(zoomRange:)](#/s:11MapTilerSDK13MTBoundingBoxV25estimatedTileCountPerZoom9zoomRangeSDyS2iGAA09MTOfflinejL0V_tF)`
    
    Estimates the number of tiles required per zoom level for this bounding box.
    
    #### Declaration
    
    Swift
    
    ```
    public func estimatedTileCountPerZoom(zoomRange: MTOfflineZoomRange) -> [Int : Int]
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>zoomRange</em></code></td><td><div><p>The min and max zoom levels.</p></div></td></tr></tbody></table>
    
    #### Return Value
    
    A dictionary mapping each zoom level to its tile count.
    
-   `[init(from:)](#/s:11MapTilerSDK13MTBoundingBoxV4fromACSaySo22CLLocationCoordinate2DVG_tcfc)`
    
    Creates a bounding box that contains all the given coordinates.
    
    #### Declaration
    
    Swift
    
    ```
    public init(from coordinates: [CLLocationCoordinate2D])
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>The coordinates to include.</p></div></td></tr></tbody></table>
