Skip to content

Commit 3f79e2c

Browse files
authored
Merge pull request #43 from NickAtGit/patch-1
Making canReplaceMapContent settable from outside
2 parents 13283ea + a079a30 commit 3f79e2c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

MapCache/Classes/MKMapView+MapCache.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ extension MKMapView {
1616
/// Will tell the map to use the cache passed as parameter for getting the tiles.
1717
///
1818
/// - Parameter cache: A cache that implements the `MapCacheProtocol`. Typically an instance of `MapCache`
19+
/// - Parameter canReplaceMapContent: Does the overlay replace the default map? It can be used to add a tile layer with centain level of transparency.
1920
///
2021
/// - SeeAlso: `Readme`
2122
@discardableResult
22-
public func useCache(_ cache: MapCacheProtocol) -> CachedTileOverlay {
23+
public func useCache(_ cache: MapCacheProtocol, canReplaceMapContent: Bool = true) -> CachedTileOverlay {
2324

2425
let tileServerOverlay = CachedTileOverlay(withCache: cache)
25-
tileServerOverlay.canReplaceMapContent = true
26+
tileServerOverlay.canReplaceMapContent = canReplaceMapContent
2627

2728
// Don't set `maximumZ` when wanting "over zooming".
2829
// TileOverlay will stop trying in zoom levels beyond `maximumZ`.

0 commit comments

Comments
 (0)