MTOfflineRegionDefinition
public struct MTOfflineRegionDefinition : Codable, Equatable, Sendable
Defines a region for offline download.
-
The geometry of the region.
Declaration
Swift
public let geometry: MTOfflineRegionGeometry -
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 setminZoomto 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 -
The maximum zoom level.
Higher zoom levels provide street-level detail but exponentially increase the storage size.
Note
If you request amaxZoomthat 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 -
The reference style for the map.
Declaration
Swift
public let referenceStyle: MTMapReferenceStyle -
The optional style variant.
Declaration
Swift
public let styleVariant: MTMapStyleVariant? -
The device pixel ratio.
Declaration
Swift
public let pixelRatio: Float -
The maximum number of tiles allowed for this region.
Declaration
Swift
public let maxTileCount: Int? -
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? -
The bounding box of the region.
Declaration
Swift
public var bbox: MTBoundingBox { get } -
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 ) -
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 ) -
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws