Offline Maps
-
An object conforming to the
VBDOfflineRegionprotocol determines which resources are required by anVBDOfflinePackobject. At present, only instances ofVBDTilePyramidOfflineRegionmay be used asVBDOfflinePackregions, but additional conforming implementations may be added in the future.Declaration
Objective-C
@protocol VBDOfflineRegion <NSObject>
-
VBDOfflineStorage implements a singleton (shared object) that manages offline packs. All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. The shared object maintains a canonical collection of offline packs in its
See morepacksproperty.Declaration
Objective-C
@interface VBDOfflineStorage : NSObject -
A block to be called once an offline pack has been completely created and added.
An application typically calls the
-resumemethod on the pack inside this completion handler to begin the download.Declaration
Objective-C
typedef void (^VBDOfflinePackAdditionCompletionHandler)( VBDOfflinePack *_Nullable, NSError *_Nullable)Parameters
packContains a pointer to the newly added pack, or
nilif there was an error creating or adding the pack.errorContains a pointer to an error object (if any) indicating why the pack could not be created or added.
-
Posted by the shared
VBDOfflineStorageobject whenever anVBDOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theVBDOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theVBDOfflinePackErrorUserInfoKeykey.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackErrorNotification -
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anVBDOfflinePackErrorNotificationnotification. The error’s domain isVBDErrorDomain. SeeVBDErrorCodefor possible error codes.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackErrorUserInfoKey -
The key for an
NSNumberobject that indicates the maximum number of Vietbando-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anVBDOfflinePackMaximumVietbandoTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackMaximumCountUserInfoKey -
Posted by the shared
VBDOfflineStorageobject when the maximum number of Vietbando-hosted tiles has been downloaded and stored on the current device.The
objectis theVBDOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theVBDOfflinePackMaximumCountUserInfoKeykey.Once this limit is reached, no instance of
VBDOfflinePackcan download additional tiles from Vietbando APIs until already downloaded tiles are removed by calling the-[VBDOfflineStorage removePack:withCompletionHandler:]method. Contact your Vietbando sales representative to have the limit raised.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackMaximumVietbandoTilesReachedNotification -
Posted by the shared
VBDOfflineStorageobject when anVBDOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theVBDOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theVBDOfflinePackStateUserInfoKeykey and details about the pack’s current progress in theVBDOfflinePackProgressUserInfoKeykey. You may also consult the pack’sstateandprogressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackProgressChangedNotification -
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anVBDOfflinePackProgressChangedNotificationnotification. Call-VBDOfflinePackProgressValueon the object to receive theVBDOfflinePackProgress-typed progress.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackProgressUserInfoKey -
A block to be called once an offline pack has been completely invalidated and removed.
Avoid any references to the pack inside this completion handler: by the time this completion handler is executed, the pack has become invalid, and any messages passed to it will raise an exception.
Declaration
Objective-C
typedef void (^VBDOfflinePackRemovalCompletionHandler)(NSError *_Nullable)Parameters
errorContains a pointer to an error object (if any) indicating why the pack could not be invalidated or removed.
-
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anVBDOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theVBDOfflinePackState-typed state.Declaration
Objective-C
extern NSString *const _Nonnull VBDOfflinePackStateUserInfoKey
-
An
VBDOfflinePackrepresents a collection of resources necessary for viewing a region offline to a local database.To create an instance of
See moreVBDOfflinePack, use the+[VBDOfflineStorage addPackForRegion:withContext:completionHandler:]method. A pack created using-[VBDOfflinePack init]is immediately invalid.Declaration
Objective-C
@interface VBDOfflinePack : NSObject -
A structure containing information about an offline pack’s current download progress.
See moreDeclaration
Objective-C
struct VBDOfflinePackProgress {} -
The state an offline pack is currently in.
See moreDeclaration
Objective-C
enum VBDOfflinePackState : NSInteger {}
-
An offline region defined by a style URL, geographic coordinate bounds, and range of zoom levels.
See moreDeclaration
Objective-C
@interface VBDTilePyramidOfflineRegion : NSObject <VBDOfflineRegion, NSSecureCoding, NSCopying>
Offline Maps Reference