@protocol MGLOfflinePackDelegate <NSObject>
MGLOfflinePackDelegate protocol defines methods that a delegate of an
MGLOfflinePack object can optionally implement to be notified of any changes
in the pack’s download progress and of any errors while downloading.
Sent whenever the pack’s state or download progress changes. Every change to a field in the
progressproperty corresponds to an invocation of this method.
- (void)offlinePack:(nonnull MGLOfflinePack *)pack progressDidChange:(MGLOfflinePackProgress)progress;
The pack whose state of progress changed.
The updated progress. To get the updated state, refer to the
Sent whenever the pack encounters an error while downloading.
Download errors may be recoverable. For example, this pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.
- (void)offlinePack:(nonnull MGLOfflinePack *)pack didReceiveError:(nonnull NSError *)error;
The pack that encountered an error.
A download error. For a list of possible error codes, see
Sent when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.
Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the
-[MGLOfflineStorage removePack:withCompletionHandler:]method. Contact your Mapbox sales representative to have the limit raised.
- (void)offlinePack:(nonnull MGLOfflinePack *)pack didReceiveMaximumAllowedMapboxTiles:(uint64_t)maximumCount;