SYMapInstaller Class Reference

Provides methods which facilitate usage of offline map data capabilities. Some calls made to SYMapLoader are asynchronous and return results through the SYMapLoaderDelegate protocol. More...

#import <SYMapInstaller.h>

Inheritance diagram for SYMapInstaller:
Collaboration diagram for SYMapInstaller:

Instance Methods

(nonnull SYTask *) - getAvailableCountries:completion:
 Fetches available maps matching the requested filter. When finished, it calls the callback with the list of available map ISO codes. More...
 
(void) - resumePendingInstallations:
 Resumes all pending map installations (updates included). If the installation progress should be reported, use the "mapinstaller_register_on_progress_callback" function to register it. If the notification about finished installation is needed, use the "mapinstaller_register_on_resumed_install_done_callback" function to register it. More...
 
(nonnull SYTask *) - detectCurrentCountry:completion:
 Detects the country of current location by IP address, or by ISO code of a region. More...
 
(nonnull SYTask *) - installMap:completion:
 Downloads and installs the requested map. If the installation progress should be reported, use the "maploader_register_on_progress_callback" function to register it. More...
 
(nonnull SYTask *) - uninstallMap:completion:
 Uninstalls the requested map. More...
 
(void) - getMapStatus:completion:
 Fetches the status of requested map (country or region) asynchronously. More...
 
(void) - loadMap:completion:
 Loads installed map (country or region) asynchronously. More...
 
(void) - unloadMap:completion:
 Unloads loaded map asynchronously. More...
 
(void) - loadMaps:completion:
 Loads an array of installed maps (country or region) asynchronously. More...
 
(void) - unloadMaps:completion:
 Unloads an array of loaded maps asynchronously. More...
 
(nonnull SYTask *) - checkForUpdatesWithCompletion:
 Checks for map updates. More...
 
(nonnull SYTask *) - updateMap:completion:
 Updates map with given ISO code. If the update progress should be reported, use the "maploader_register_on_progress_callback" function to register it. In case of successful update, the map will be loaded. More...
 
(void) - getCountryDetails:installedOnly:completion:
 Fetch details about a country asynchronously. More...
 
(void) - getRegionDetails:installedOnly:completion:
 Fetch details about a country region asynchronously. More...
 
(void) - setLocale:completion:
 Sets the locale of MapInstaller's data (the MapLists). Fetches localized MapList from the API and translates local data. Returns SYMapInstallerResultUnsupportedLocale if desired locale is not supported by the maps API. All MapInstaller calls, which return some localized data (getCountryDetails, getRegionDetails, ...), called afterwards, will return localized content (if the locale is supported). More...
 
(void) - clearCacheWithCompletion:
 Clear the MapInstaller cache. Clearing the cache will fetch the most recent data (MapList) from the MapsAPI. More...
 

Properties

id< SYMapInstallerDelegatedelegate
 Current SYMapInstallerDelegate. More...
 

Detailed Description

Provides methods which facilitate usage of offline map data capabilities. Some calls made to SYMapLoader are asynchronous and return results through the SYMapLoaderDelegate protocol.

Method Documentation

◆ getAvailableCountries:completion:

- (nonnull SYTask*) getAvailableCountries: (SYMapInstallerMapFilter)  filter
completion: (nonnull SYMapInstallerMapArrayCompletionBlock)  completion 

Fetches available maps matching the requested filter. When finished, it calls the callback with the list of available map ISO codes.

Parameters
filterSYMapInstallerMapFilterAll - includes already installed maps and maps available for download SYMapInstallerMapFilterInstalled - includes only already installed maps
completionblock used as a callback for this function
Returns
SYTask cancelation object

◆ resumePendingInstallations:

- (void) resumePendingInstallations: (nonnull SYMapInstallerResumeInfoBlock)  infoCallback

Resumes all pending map installations (updates included). If the installation progress should be reported, use the "mapinstaller_register_on_progress_callback" function to register it. If the notification about finished installation is needed, use the "mapinstaller_register_on_resumed_install_done_callback" function to register it.

Parameters
infoCallbackBlock used as a callback for resume information.

◆ detectCurrentCountry:completion:

- (nonnull SYTask*) detectCurrentCountry: (nullable NSString *)  country
completion: (nonnull SYMapInstallerOneMapCompletionBlock)  completion 

Detects the country of current location by IP address, or by ISO code of a region.

Parameters
countryshould be nil for detection current country by IP address. If provided ISO code of a region, ISO code of the whole country will be returned.
completionblock is called after the detection process finishes, called with ISO code of the detected country.
Returns
SYTask cancelation object

◆ installMap:completion:

- (nonnull SYTask*) installMap: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerOneMapCompletionBlock)  completion 

Downloads and installs the requested map. If the installation progress should be reported, use the "maploader_register_on_progress_callback" function to register it.

Parameters
mapISO code of map to be downloaded and installed.
completionblock is called after the installation finishes, called with ISO code and installation result
Returns
SYTask cancelation object

◆ uninstallMap:completion:

- (nonnull SYTask*) uninstallMap: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerOneMapCompletionBlock)  completion 

Uninstalls the requested map.

Parameters
mapISO code of map to be uninstalled.
completionblock is called after the completion of the uninstall process. Called with map ISO code and uninstall result.
Returns
SYTask cancelation object

◆ getMapStatus:completion:

- (void) getMapStatus: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerMapStatusCompletionBlock)  completion 

Fetches the status of requested map (country or region) asynchronously.

Parameters
mapISO code of the map.
completionblock is called when the status is ready. Called with SYMapLoaderResult and SYMapLoaderMapStatus.

◆ loadMap:completion:

- (void) loadMap: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerResultCompletionBlock)  completion 

Loads installed map (country or region) asynchronously.

Parameters
mapISO code of the map to be loaded.
completionblock is called after the map is loaded. Called with SYMapInstallerResult.

◆ unloadMap:completion:

- (void) unloadMap: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerResultCompletionBlock)  completion 

Unloads loaded map asynchronously.

Parameters
mapISO code of the map to be unloaded.
completionblock is called after the map is unloaded. Called with SYMapInstallerResult.

◆ loadMaps:completion:

- (void) loadMaps: (nonnull NSArray< SYCountryIso * > *)  maps
completion: (nonnull SYMapInstallerResultCompletionBlock)  completion 

Loads an array of installed maps (country or region) asynchronously.

Parameters
mapsarray of map ISO codes to be loaded.
completionblock is called after the maps are loaded. Called with SYMapLoaderResult.

◆ unloadMaps:completion:

- (void) unloadMaps: (nonnull NSArray< SYCountryIso * > *)  maps
completion: (nonnull SYMapInstallerResultCompletionBlock)  completion 

Unloads an array of loaded maps asynchronously.

Parameters
mapsarray of map ISO codes to be unloaded.
completionblock is called after the maps are unloaded. Called with SYMapLoaderResult.

◆ checkForUpdatesWithCompletion:

- (nonnull SYTask*) checkForUpdatesWithCompletion: (nonnull SYMapInstallerMapArrayCompletionBlock)  completion

Checks for map updates.

Parameters
completionblock is called with the check result and list of ISO codes, representing the maps for which an update is available.
Returns
SYTask cancelation object

◆ updateMap:completion:

- (nonnull SYTask*) updateMap: (nonnull SYCountryIso *)  map
completion: (nonnull SYMapInstallerOneMapCompletionBlock)  completion 

Updates map with given ISO code. If the update progress should be reported, use the "maploader_register_on_progress_callback" function to register it. In case of successful update, the map will be loaded.

Parameters
mapISO code of map, for which an update should be performed.
completionblock is called after the update is complete, called with ISO code of the map and status.
Returns
SYTask cancelation object

◆ getCountryDetails:installedOnly:completion:

- (void) getCountryDetails: (nonnull SYCountryIso *)  map
installedOnly: (BOOL)  installed
completion: (nonnull SYMapInstallerCountryDetailsCompletionBlock)  completion 

Fetch details about a country asynchronously.

Parameters
mapISO code of the requested country.
completionblock is called when the details are ready. Called with SYMapInstallerResult and SYCountryDetails.

◆ getRegionDetails:installedOnly:completion:

- (void) getRegionDetails: (nonnull SYCountryIso *)  map
installedOnly: (BOOL)  installed
completion: (nonnull SYMapInstallerRegionDetailsCompletionBlock)  completion 

Fetch details about a country region asynchronously.

Parameters
mapISO code of the requested region.
completionblock is called when the details are ready. Called with SYMapInstallerResult and SYRegionDetails.

◆ setLocale:completion:

- (void) setLocale: (nonnull NSString *)  locale
completion: (nonnull SYMapInstallerResultCompletionBlock)  completion 

Sets the locale of MapInstaller's data (the MapLists). Fetches localized MapList from the API and translates local data. Returns SYMapInstallerResultUnsupportedLocale if desired locale is not supported by the maps API. All MapInstaller calls, which return some localized data (getCountryDetails, getRegionDetails, ...), called afterwards, will return localized content (if the locale is supported).

Parameters
localeBCP 47 language tag, containing the desired locale of the content.
completionblock is called after setting locale is processed. Called with SYMapLoaderResult.

◆ clearCacheWithCompletion:

- (void) clearCacheWithCompletion: (nonnull SYMapInstallerResultCompletionBlock)  completion

Clear the MapInstaller cache. Clearing the cache will fetch the most recent data (MapList) from the MapsAPI.

Parameters
completionBlock that is called when the cache is cleared.

Property Documentation

◆ delegate

- (id<SYMapInstallerDelegate>) delegate
readwritenonatomicweak

The documentation for this class was generated from the following file: