CachedTileOverlay
open class CachedTileOverlay : MKTileOverlay
Whenever a tile is requested by the MapView, it calls the MKTileOverlay.loadTile.
This class overrides the default MKTileOverlayto provide support to MapCache.
See also
MkMapView+MapCache
-
A class that implements the
MapCacheProtocolDeclaration
Swift
let mapCache: MapCacheProtocol -
If true
loadTileuses the implementation of themapCachevar. Iffalse, uses the defaultMKTileOverlayimplementation from Apple.Declaration
Swift
public var useCache: Bool -
Constructor.
Declaration
Swift
public init(withCache cache: MapCacheProtocol)Parameters
withCachethe cache to be used on
loadTile -
Generates the URL for the tile to be requested. It replaces the values of {z},{x} and {y} in the
urlTemplatedefined inmapCache.configDeclaration
Swift
override public func url(forTilePath path: MKTileOverlayPath) -> URL -
Tells whether or not to upsample and show a lesser detailed z level takes into account
useZoomconfiguration as well as current andmaximumZvaluesDeclaration
Swift
func shouldZoom(at scale: MKZoomScale) -> Bool -
Given the maximum zoom level for the tileset
(mapCache.config.maximumZ) it will return the tile, map rects, and additional scaling factor for upscaling tiles.Declaration
Swift
func tilesInMapRect(rect: MKMapRect, scale: MKZoomScale) -> [ZoomableTile]Parameters
rectmap rectangle for which we want to get the tile set
scalecurrent zoom scale
View on GitHub
CachedTileOverlay Class Reference