RegionDownloader

@objc
public class RegionDownloader : NSObject

Hey! I need to download this area No problemo.

  • Average number of bytes of a tile

    Declaration

    Swift

    static let defaultAverageTileSizeBytes: UInt64
  • region that will be downloaded

    Declaration

    Swift

    public let region: TileCoordsRegion
  • Cache that is going to be used for saving/loading the files.

    Declaration

    Swift

    public let mapCache: MapCacheProtocol
  • Total number of tiles to be downloaded

    Declaration

    Swift

    public var totalTilesToDownload: TileNumber { get }
  • Number of tiles pending to be downloaded

    Declaration

    Swift

    public var pendingTilesToDownload: TileNumber { get }
  • Undocumented

    Declaration

    Swift

    private var _downloadedBytes: UInt64
  • Total number of downloaded data bytes

    Declaration

    Swift

    public var downloadedBytes: UInt64 { get }
  • Returns the average

    This can be used to estimate the

    Declaration

    Swift

    public var averageTileSizeBytes: UInt64 { get }
  • Keeps the number of tiles already downloaded successfully or failed.

    Declaration

    Swift

    @objc
    dynamic public var downloadedTiles: TileNumber { get }
  • Declaration

    Swift

    private var _successfulTileDownloads: TileNumber
  • Keeps the number of tiles already downloaded.

    Declaration

    Swift

    @objc
    dynamic public var successfulTileDownloads: TileNumber { get }
  • Keeps the number of tiles failes to be downloaded Publicly accessible through failledTIleDownloads

    Declaration

    Swift

    private var _failedTileDownloads: TileNumber
  • Number of tiles to be downloaded

    Declaration

    Swift

    @objc
    dynamic public var failedTileDownloads: TileNumber { get }
  • Percentage to notify thought delegate If set to >100 will only notify on finish download If set to a percentage < downloadedPercentage, will never notify.

    Declaration

    Swift

    public var nextPercentageToNotify: Double
  • The downloader will notify the delegate every time this For example if you set this to 5, it will notify when 5%, 10%, 15%, etc… default value 5.

    Declaration

    Swift

    public var incrementInPercentageNotification: Double
  • Last notified

    Declaration

    Swift

    var lastPercentageNotified: Double
  • Percentage of tiles pending to download.

    Declaration

    Swift

    public var downloadedPercentage: Double { get }
  • Delegate

    Declaration

    Swift

    public var delegate: RegionDownloaderDelegate?
  • Queue to download stuff.

    Declaration

    Swift

    lazy var downloaderQueue: DispatchQueue { get set }
  • initializes the downloader with the region and the MapCache

    Declaration

    Swift

    public init(forRegion region: TileCoordsRegion, mapCache: MapCacheProtocol)
  • Starts download

    Declaration

    Swift

    public func start()
  • Returns an estimation of the total number of bytes the whole region may occupy. It is an estimation.

    Declaration

    Swift

    public func estimateRegionByteSize() -> UInt64