MaplyTileLocalStorage

Objective-C

@protocol MaplyTileLocalStorage <NSObject>

Swift

protocol MaplyTileLocalStorage : NSObjectProtocol

If you provide LocalStore the RemoteTileFetcher will look for data in local storage first, then try the local file cache and lastly go to the network.

You can provide the local storage by filling out this protocol and passing it to the RemoteTileFetcher.

Expect to be called on a random thread and block appropriately.

  • Return the data for the given tile. nil means you don’t have the tile, so we’ll try other sources. fetchInfo is a MaplyRemoteTileFetchInfo describing the rest of the tile characteristics. tileID is the tile in question.

    Declaration

    Objective-C

    - (NSData *_Nullable)dataForTile:(MaplyRemoteTileFetchInfo *_Nonnull)fetchInfo
                              tileID:(MaplyTileID)tileID;

    Swift

    func data(forTile fetchInfo: MaplyRemoteTileFetchInfo, tileID: MaplyTileID) -> Data?