MTOfflineZoomRange

public struct MTOfflineZoomRange : Equatable

Defines and validates a zoom range for offline tile calculations.

  • Undocumented

    Declaration

    Swift

    public let minZoom: Int
  • Undocumented

    Declaration

    Swift

    public let maxZoom: Int
  • Initializes a zoom range.

    Throws

    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

    minZoom

    The minimum zoom level. Must be >= 0.

    maxZoom

    The maximum zoom level. Must be >= 0 and >= minZoom.

  • 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

    sourceMin

    The minimum zoom level supported by the source.

    sourceMax

    The maximum zoom level supported by the source.

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