MapsContext

Objective-C


@interface MapsContext : NSObject

Swift

class MapsContext : NSObject

This class handles the maps.

  • Check if the online maps content is preloaded. @details If the content is not cached locally a call to preloadContentWithCompletionHandler must be performed.

    Declaration

    Objective-C

    - (BOOL)isContentPreloaded;

    Swift

    func isContentPreloaded() -> Bool
  • Preload the online maps content.

    Declaration

    Objective-C

    - (void)preloadContentWithCompletionHandler:(nonnull void (^)(BOOL))handler;

    Swift

    func preloadContent() async -> Bool
  • Returns the local maps list.

    Declaration

    Objective-C

    - (nonnull NSArray<ContentStoreObject *> *)getLocalList;

    Swift

    func getLocalList() -> [ContentStoreObject]
  • Asynchronously returns the online maps list.

    Declaration

    Objective-C

    - (void)getOnlineListWithCompletionHandler:
        (nonnull void (^)(NSArray<ContentStoreObject *> *_Nonnull))handler;

    Swift

    func onlineList() async -> [ContentStoreObject]
  • Start a download request for the given map identifier.

    Declaration

    Objective-C

    - (void)downloadMapWithIdentifier:(NSInteger)identifier
                 allowCellularNetwork:(BOOL)allowCellularNetwork
                    completionHandler:(nonnull void (^)(BOOL))handler;

    Swift

    func downloadMap(withIdentifier identifier: Int, allowCellularNetwork: Bool) async -> Bool

    Parameters

    identifier

    The style identifier.

    allowCellularNetwork

    The flag whether to allow charged networks.

    handler

    The block to execute asynchronously with the result.

  • Check if there is an update available.

    Declaration

    Objective-C

    - (void)checkForUpdateWithCompletionHandler:
        (nonnull void (^)(ContentStoreOnlineSupportStatus))handler;

    Swift

    func checkForUpdate() async -> ContentStoreOnlineSupportStatus

    Parameters

    handler

    The block to execute asynchronously with the content online support status.

  • Returns the update size ( if an update is available ).

    Declaration

    Objective-C

    - (NSInteger)getUpdateSize;

    Swift

    func getUpdateSize() -> Int
  • Returns the update size string formatted ( if an update is available ).

    Declaration

    Objective-C

    - (nonnull NSString *)getUpdateSizeFormatted;

    Swift

    func getUpdateSizeFormatted() -> String
  • The delegate for the content update.

    Declaration

    Objective-C

    @property (nonatomic, weak) NSObject<ContentUpdateDelegate> *_Nullable delegateUpdate;

    Swift

    weak var delegateUpdate: (any ContentUpdateDelegate)? { get set }
  • Start the update process.

    Declaration

    Objective-C

    - (void)updateWithAllowCellularNetwork:(BOOL)allowCellularNetwork
                         completionHandler:(nonnull void (^)(BOOL))handler;

    Swift

    func update(withAllowCellularNetwork allowCellularNetwork: Bool) async -> Bool

    Parameters

    allowCellularNetwork

    The flag whether to allow charged networks.

    handler

    The block to execute asynchronously with the result.

  • Returns the content items list in update process.

    Declaration

    Objective-C

    - (nonnull NSArray<ContentStoreObject *> *)getUpdateItems;

    Swift

    func getUpdateItems() -> [ContentStoreObject]
  • Returns the update operation status.

    Declaration

    Objective-C

    - (ContentUpdateStatus)getUpdateStatus;

    Swift

    func getUpdateStatus() -> ContentUpdateStatus
  • Returns the update operation progress.

    Declaration

    Objective-C

    - (NSInteger)getUpdateProgress;

    Swift

    func getUpdateProgress() -> Int
  • Returns true if an update is already started.

    Declaration

    Objective-C

    - (BOOL)isUpdateStarted;

    Swift

    func isUpdateStarted() -> Bool
  • Cancel the update process.

    Declaration

    Objective-C

    - (void)cancelUpdate;

    Swift

    func cancelUpdate()
  • Returns the world map version.

    Declaration

    Objective-C

    - (nonnull NSString *)getWorldMapVersion;

    Swift

    func getWorldMapVersion() -> String
  • Returns the country image flag.

    Declaration

    Objective-C

    - (nullable UIImage *)getCountryFlagWithIsoCode:(nonnull NSString *)code
                                               size:(CGSize)size;

    Swift

    func getCountryFlag(withIsoCode code: String, size: CGSize) -> UIImage?

    Parameters

    code

    The country code.

    size

    The image size.

  • Set parallel downloads count. Default is 0 (unlimited).

    Declaration

    Objective-C

    - (void)setParallelDownloadsLimit:(int)count;

    Swift

    func setParallelDownloadsLimit(_ count: Int32)
  • Returns formatted size.

    Declaration

    Objective-C

    - (nonnull NSString *)getSizeFormatted:(double)value;

    Swift

    func getSizeFormatted(_ value: Double) -> String