Skip to content

Commit

Permalink
Merge pull request #43 from NickAtGit/patch-1
Browse files Browse the repository at this point in the history
Making canReplaceMapContent settable from outside
  • Loading branch information
merlos authored May 20, 2023
2 parents 13283ea + a079a30 commit 3f79e2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MapCache/Classes/MKMapView+MapCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ extension MKMapView {
/// Will tell the map to use the cache passed as parameter for getting the tiles.
///
/// - Parameter cache: A cache that implements the `MapCacheProtocol`. Typically an instance of `MapCache`
/// - Parameter canReplaceMapContent: Does the overlay replace the default map? It can be used to add a tile layer with centain level of transparency.
///
/// - SeeAlso: `Readme`
@discardableResult
public func useCache(_ cache: MapCacheProtocol) -> CachedTileOverlay {
public func useCache(_ cache: MapCacheProtocol, canReplaceMapContent: Bool = true) -> CachedTileOverlay {

let tileServerOverlay = CachedTileOverlay(withCache: cache)
tileServerOverlay.canReplaceMapContent = true
tileServerOverlay.canReplaceMapContent = canReplaceMapContent

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

0 comments on commit 3f79e2c

Please sign in to comment.