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

    Readme

    Declaration

    Swift

    @discardableResult
    @MainActor
    public func useCache(_ cache: MapCacheProtocol, canReplaceMapContent: Bool = true, overlayLevel: MKOverlayLevel = .aboveLabels) -> CachedTileOverlay

    Parameters

    cache

    A cache that implements the MapCacheProtocol. Typically an instance of MapCache

    canReplaceMapContent

    Does the overlay replace the default map? It can be used to add a tile layer with centain level of transparency.

    overlayLevel

    The overlay level to use. Default is .aboveLabels. Other values: .aboveRoads, .aboveLabels. See MKOverlayLevel for up to date information.

  • Call this method within the MKMapView delegate function mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer

    See also

    Example project and Readme documentation

    Declaration

    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 }