MaplyMultiplexTileSourceDelegate

@protocol MaplyMultiplexTileSourceDelegate <NSObject>

A delegate called during various parts of the tile loading and display operation.

The remote tile source delegate provides feedback on which tiles loaded and which didn’t. You’ll be called in all sorts of random threads here, so act accordingly.

This delegate interface can also be used to modify data as it comes in.

  • The tile successfully loaded.

    Declaration

    Objective-C

    - (void)remoteTileInfo:(id _Nonnull)tileInfo
               tileDidLoad:(MaplyTileID)tileID
                     frame:(int)frame;

    Swift

    optional func remoteTileInfo(_ tileInfo: Any, tileDidLoad tileID: MaplyTileID, frame: Int32)

    Parameters

    tileInfo

    TileInfo corresponding to the data that was loaded.

    tileID

    The ID of the tile we loaded.

    frame

    The frame loaded.

  • Modify the tile data after it’s been read.

    This method is useful for messing with tile sources that may not be images, but can be turned into images.

    Declaration

    Objective-C

    - (nonnull NSData *)remoteTileInfo:(id _Nonnull)tileInfo
                      modifyTileReturn:(NSData *_Nonnull)tileData
                               forTile:(MaplyTileID)tileID
                                 frame:(int)frame;

    Swift

    optional func remoteTileInfo(_ tileInfo: Any, modifyTileReturn tileData: Data, forTile tileID: MaplyTileID, frame: Int32) -> Data
  • The tile failed to load.

    Declaration

    Objective-C

    - (void)remoteTileInfo:(id _Nonnull)tileInfo
            tileDidNotLoad:(MaplyTileID)tileID
                     frame:(int)frame
                     error:(NSError *_Nonnull)error;

    Swift

    optional func remoteTileInfo(_ tileInfo: Any, tileDidNotLoad tileID: MaplyTileID, frame: Int32, error: Error)

    Parameters

    tileInfo

    TileInfo corresponding to the data that was loaded.

    tileID

    The tile ID of the tile that failed to load.

    error

    The NSError message, probably from the network routine.

  • Called when the tile is unloaded.

    Normally you won’t get called when an image or vector tile is unloaded from memory. If you set this, you will.

    You’re not required to do anything, but you can clean up data of your own if you like.

    You will be called on another thread, so act accordingly.

    Declaration

    Objective-C

    - (void)remoteTileInfo:(id _Nonnull)tileInfo
              tileUnloaded:(MaplyTileID)tileID
                     frame:(int)frame;

    Swift

    optional func remoteTileInfo(_ tileInfo: Any, tileUnloaded tileID: MaplyTileID, frame: Int32)

    Parameters

    tileID

    The tile that that just got unloaded.