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 <SYMapLoader.h>
|
(nonnull SYTask *) | - getAvailableCountries:withCompletion: |
| 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 "maploader_register_on_progress_callback" function to register it. If the notification about finished installation is needed, use the "maploader_register_on_resumed_install_done_callback" function to register it. More...
|
|
(nonnull SYTask *) | - detectCurrentCountry:withCompletion: |
| Detects the country of current location by IP address, or by ISO code of a region. More...
|
|
(nonnull SYTask *) | - installMap:withCompletion: |
| 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:withCompletion: |
| 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:withCompletion: |
| 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 MapLoader's data (the MapLists). Fetches localized MapList from the API and translates local data. Returns SYMapLoaderResultUnsupportedLocale if desired locale is not supported by the maps API. All MapLoader calls, which return some localized data (getCountryDetails, getRegionDetails, ...), called afterwards, will return localized content (if the locale is supported). More...
|
|
(void) | - clearCacheWithCompletion: |
| Clear the MapLoader cache. Clearing the cache will fetch the most recent data (MapList) from the MapsAPI. More...
|
|
Provides methods which facilitate usage of offline map data capabilities. Some calls made to SYMapLoader are asynchronous and return results through the SYMapLoaderDelegate protocol.
◆ getAvailableCountries:withCompletion:
- (nonnull SYTask*) getAvailableCountries: |
|
(SYMapLoaderMapFilter) |
filter |
withCompletion: |
|
(nonnull SYMapLoaderMapArrayCompletionBlock) |
completion |
|
|
| |
Fetches available maps matching the requested filter. When finished, it calls the callback with the list of available map ISO codes.
- Parameters
-
filter | SYMapLoaderMapFilterAll - includes already installed maps and maps available for download SYMapLoaderMapFilterInstalled - includes only already installed maps |
completion | block used as a callback for this function |
- Returns
- SYTask cancelation object
◆ resumePendingInstallations:
- (void) resumePendingInstallations: |
|
(nonnull SYMapLoaderResumeInfoBlock) |
infoCallback |
|
Resumes all pending map installations (updates included). If the installation progress should be reported, use the "maploader_register_on_progress_callback" function to register it. If the notification about finished installation is needed, use the "maploader_register_on_resumed_install_done_callback" function to register it.
- Parameters
-
infoCallback | Block used as a callback for resume information. |
◆ detectCurrentCountry:withCompletion:
- (nonnull SYTask*) detectCurrentCountry: |
|
(nullable NSString *) |
country |
withCompletion: |
|
(nonnull SYMapLoaderOneMapCompletionBlock) |
completion |
|
|
| |
Detects the country of current location by IP address, or by ISO code of a region.
- Parameters
-
country | should 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. |
completion | block is called after the detection process finishes, called with ISO code of the detected country. |
- Returns
- SYTask cancelation object
◆ installMap:withCompletion:
- (nonnull SYTask*) installMap: |
|
(nonnull SYCountryIso *) |
map |
withCompletion: |
|
(nonnull SYMapLoaderOneMapCompletionBlock) |
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
-
map | ISO code of map to be downloaded and installed. |
completion | block is called after the installation finishes, called with ISO code and installation result |
- Returns
- SYTask cancelation object
◆ uninstallMap:withCompletion:
- (nonnull SYTask*) uninstallMap: |
|
(nonnull SYCountryIso *) |
map |
withCompletion: |
|
(nonnull SYMapLoaderOneMapCompletionBlock) |
completion |
|
|
| |
Uninstalls the requested map.
- Parameters
-
map | ISO code of map to be uninstalled. |
completion | block 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 SYMapLoaderMapStatusCompletionBlock) |
completion |
|
|
| |
Fetches the status of requested map (country or region) asynchronously.
- Parameters
-
map | ISO code of the map. |
completion | block is called when the status is ready. Called with SYMapLoaderResult and SYMapLoaderMapStatus. |
◆ loadMap:completion:
- (void) loadMap: |
|
(nonnull SYCountryIso *) |
map |
completion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
|
| |
Loads installed map (country or region) asynchronously.
- Parameters
-
map | ISO code of the map to be loaded. |
completion | block is called after the map is loaded. Called with SYMapLoaderResult. |
◆ unloadMap:completion:
- (void) unloadMap: |
|
(nonnull SYCountryIso *) |
map |
completion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
|
| |
Unloads loaded map asynchronously.
- Parameters
-
map | ISO code of the map to be unloaded. |
completion | block is called after the map is unloaded. Called with SYMapLoaderResult. |
◆ loadMaps:completion:
- (void) loadMaps: |
|
(nonnull NSArray< SYCountryIso * > *) |
maps |
completion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
|
| |
Loads an array of installed maps (country or region) asynchronously.
- Parameters
-
maps | array of map ISO codes to be loaded. |
completion | block is called after the maps are loaded. Called with SYMapLoaderResult. |
◆ unloadMaps:completion:
- (void) unloadMaps: |
|
(nonnull NSArray< SYCountryIso * > *) |
maps |
completion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
|
| |
Unloads an array of loaded maps asynchronously.
- Parameters
-
maps | array of map ISO codes to be unloaded. |
completion | block is called after the maps are unloaded. Called with SYMapLoaderResult. |
◆ checkForUpdatesWithCompletion:
- (nonnull SYTask*) checkForUpdatesWithCompletion: |
|
(nonnull SYMapLoaderMapArrayCompletionBlock) |
completion |
|
Checks for map updates.
- Parameters
-
completion | block 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:withCompletion:
- (nonnull SYTask*) updateMap: |
|
(nonnull SYCountryIso *) |
map |
withCompletion: |
|
(nonnull SYMapLoaderOneMapCompletionBlock) |
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
-
map | ISO code of map, for which an update should be performed. |
completion | block 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 SYMapLoaderCountryDetailsCompletionBlock) |
completion |
|
|
| |
Fetch details about a country asynchronously.
- Parameters
-
map | ISO code of the requested country. |
completion | block is called when the details are ready. Called with SYMapLoaderResult and SYCountryDetails. |
◆ getRegionDetails:installedOnly:completion:
- (void) getRegionDetails: |
|
(nonnull SYCountryIso *) |
map |
installedOnly: |
|
(BOOL) |
installed |
completion: |
|
(nonnull SYMapLoaderRegionDetailsCompletionBlock) |
completion |
|
|
| |
Fetch details about a country region asynchronously.
- Parameters
-
map | ISO code of the requested region. |
completion | block is called when the details are ready. Called with SYMapLoaderResult and SYRegionDetails. |
◆ setLocale:completion:
- (void) setLocale: |
|
(nonnull NSString *) |
locale |
completion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
|
| |
Sets the locale of MapLoader's data (the MapLists). Fetches localized MapList from the API and translates local data. Returns SYMapLoaderResultUnsupportedLocale if desired locale is not supported by the maps API. All MapLoader calls, which return some localized data (getCountryDetails, getRegionDetails, ...), called afterwards, will return localized content (if the locale is supported).
- Parameters
-
locale | BCP 47 language tag, containing the desired locale of the content. |
completion | block is called after setting locale is processed. Called with SYMapLoaderResult. |
◆ clearCacheWithCompletion:
- (void) clearCacheWithCompletion: |
|
(nonnull SYMapLoaderResultCompletionBlock) |
completion |
|
Clear the MapLoader cache. Clearing the cache will fetch the most recent data (MapList) from the MapsAPI.
- Parameters
-
completion | Block that is called when the cache is cleared. |
◆ delegate
The documentation for this class was generated from the following file: