-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathMapCacheProtocol.swift
More file actions
34 lines (28 loc) · 1004 Bytes
/
MapCacheProtocol.swift
File metadata and controls
34 lines (28 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// MapCacheProtocol.swift
// MapCache
//
// Created by merlos on 29/06/2019.
//
import Foundation
import MapKit
///
/// This protocol shall be implemented by any cache used in MapCache.
///
/// - SeeAlso: [Main Readme page](/)
///
public protocol MapCacheProtocol {
/// An instance of `MapCacheConfig`
var config: MapCacheConfig { get set }
/// The implementation shall convert a tile path into a URL object
///
/// Typically it will use the `config.urlTemplate` and `config.subdomains`.
///
/// An example of implementation can be found in the class`MapCache`
func url(forTilePath path: MKTileOverlayPath) -> URL
///
/// The implementation shall return either the tile as a Data object or an Error if the tile could not be retrieved.
///
/// - SeeAlso [MapKit.MkTileOverlay](https://developer.apple.com/documentation/mapkit/mktileoverlay)
func loadTile(at path: MKTileOverlayPath, result: @escaping (Data?, Error?) -> Void)
}