SKOfflinePackagesManager Class Reference

Inherits from NSObject
Declared in SKOfflinePackagesManager.h

Overview

SKMapsManager’s offline packages manager. Should not be explicitly allocated. Handles offline map packages management.

  installedOfflineMapPackages

Library’s installed offline packages. An array of SKMapPackage objects.

@property (nonatomic, readonly, strong) NSArray<SKMapPackage*> *installedOfflineMapPackages

Discussion

Library’s installed offline packages. An array of SKMapPackage objects.

Declared In

SKOfflinePackagesManager.h

  outdatedOfflineMapPackages

An array of SKMapPackage objects with installed offline packages that are not at the latest available map version. Check SKMapsVersioningManager for more versioning information.

@property (nonatomic, readonly, strong) NSArray<SKMapPackage*> *outdatedOfflineMapPackages

Discussion

An array of SKMapPackage objects with installed offline packages that are not at the latest available map version. Check SKMapsVersioningManager for more versioning information.

Declared In

SKOfflinePackagesManager.h

  mapDownloadBasePath

Base URL for map tiles and offline packages download.

@property (nonatomic, readonly, strong) NSString *mapDownloadBasePath

Discussion

Base URL for map tiles and offline packages download.

Declared In

SKOfflinePackagesManager.h

– addOfflineMapPackageNamed:inContainingFolderPath:shouldEraseSourcePackage:

Adds a downloaded offline map package to library. Adding an offline map package should be done only once during the lifetime of the app, unless it’s deleted. The downloaded files will be moved in the SKMaps' file structure. No other manual management of the files is needed after adding the package. This method should be used for installing downloadable content. For preinstalled maps, use the PreinstalledMaps folder included in the SKMaps.bundle.

- (SKAddPackageResult)addOfflineMapPackageNamed:(NSString *)packageName inContainingFolderPath:(NSString *)containingFolderPath shouldEraseSourcePackage:(BOOL)shouldEraseSourcePackage

Parameters

packageName

The name of the package. Ex: “RO” , “DE”, etc. , without any extension.

containingFolderPath

The path to the folder where the files are located. Expected files:

shouldEraseSourcePackage

Determines if the map package at the provided file path should be erased or not.

  • .skm file (map data file).
  • .ngi & .ngi.dat namebrowser files, used for offline searches. Usually downloaded as an archived package.
  • .syn search files, available only for some countries, used for improving offline search results. This file can be found in the same archive as the .ngi and .ngi.dat files, and is optional.
  • .txg file (texture file).

Return Value

SKAddPackageResult mask representing the result of adding the package. If the return value suggests that you are missing a .txg or .syn file, you can consider it as a success and all the offline functionalities will work for that package.

Discussion

Adds a downloaded offline map package to library. Adding an offline map package should be done only once during the lifetime of the app, unless it’s deleted. The downloaded files will be moved in the SKMaps' file structure. No other manual management of the files is needed after adding the package. This method should be used for installing downloadable content. For preinstalled maps, use the PreinstalledMaps folder included in the SKMaps.bundle.

Declared In

SKOfflinePackagesManager.h

– deleteOfflineMapPackageNamed:

Deletes an offline map package. When a package is added, the files are moved to the SKMaps' file structure. On deletion, the files on the disk are also deleted.

- (BOOL)deleteOfflineMapPackageNamed:(NSString *)packageName

Parameters

packageName

The name of the package to be deleted. Ex: RO , DE, etc. , without any extension.

Return Value

YES on success, NO on failure.

Discussion

Deletes an offline map package. When a package is added, the files are moved to the SKMaps' file structure. On deletion, the files on the disk are also deleted.

Declared In

SKOfflinePackagesManager.h

– validateMapFileAtPath:

Checks if an offline map file (.skm file) is valid. Can be used before installing offline map packages.

- (BOOL)validateMapFileAtPath:(NSString *)path

Parameters

path

Path of the .skm file.

Return Value

YES for a valid package, NO otherwise.

Discussion

Checks if an offline map file (.skm file) is valid. Can be used before installing offline map packages.

Declared In

SKOfflinePackagesManager.h

– mapXMLURLForVersion:

URL of the maps XML for the given version. The version has to be a string (“version” property of a SKVersionInformation).

- (nullable NSString *)mapXMLURLForVersion:(nullable NSString *)version

Parameters

version

Map version for the maps XML. If the parameter is nil, the current version of the map will be used.

Return Value

The URL to the maps XML for the desired version.

Discussion

URL of the maps XML for the given version. The version has to be a string (“version” property of a SKVersionInformation).

Declared In

SKOfflinePackagesManager.h

– mapJSONURLForVersion:

URL of the maps JSON for the given version. The version has to be a string (“version” property of a SKVersionInformation).

- (nullable NSString *)mapJSONURLForVersion:(nullable NSString *)version

Parameters

version

Map version for the maps JSON. If the parameter is nil, the current version of the map will be used.

Return Value

The URL to the maps JSON for the desired version.

Discussion

URL of the maps JSON for the given version. The version has to be a string (“version” property of a SKVersionInformation).

Declared In

SKOfflinePackagesManager.h

– downloadInfoForPackageWithCode:forMapVersion:

Download information (required URLs) for an offline map package code.

- (nullable SKMapPackageDownloadInfo *)downloadInfoForPackageWithCode:(NSString *)packageCode forMapVersion:(nullable NSString *)mapVersion

Parameters

packageCode

The package code (RO, DE, etc.) used to generate the package download info.

mapVersion

The map version (for example “20160426”) used to generate the wanted package download info. Use nil for current map version.

Return Value

The download info for the given package and version.

Discussion

Download information (required URLs) for an offline map package code.

Declared In

SKOfflinePackagesManager.h