MKMapView
extension MKMapView
Extension that provides MKMapView support to use MapCache.
See also
Readme documentation-
Will tell the map to use the cache passed as parameter for getting the tiles.
See also
ReadmeDeclaration
Swift
@discardableResult @MainActor public func useCache(_ cache: MapCacheProtocol, canReplaceMapContent: Bool = true, overlayLevel: MKOverlayLevel = .aboveLabels) -> CachedTileOverlayParameters
cacheA cache that implements the
MapCacheProtocol. Typically an instance ofMapCachecanReplaceMapContentDoes the overlay replace the default map? It can be used to add a tile layer with centain level of transparency.
overlayLevelThe overlay level to use. Default is
.aboveLabels. Other values:.aboveRoads,.aboveLabels. SeeMKOverlayLevelfor up to date information. -
Call this method within the MKMapView delegate function
mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRendererSee also
Example project and Readme documentationDeclaration
Swift
@MainActor public func mapCacheRenderer(forOverlay overlay: MKOverlay) -> MKOverlayRenderer -
TODO: Implement this correctly. Returns current zoom level
Declaration
Swift
@MainActor public var zoomLevel: Int { get }
View on GitHub