MapInstaller

Class providing functionality to manage offline maps on the device.

ToDo: Update documentation!

Types

Link copied to clipboard
data class InstallMapBundleInfo(val maps: List<String>) : Parcelable
Link copied to clipboard
sealed class LoadResult : Parcelable

Result of executed operation.

Link copied to clipboard
data class MapResult(val result: MapInstaller.LoadResult, val message: String) : Parcelable
Link copied to clipboard

Status of a map.

Link copied to clipboard
class Task

Class responsible for cancelling the running operation it represents.

Functions

Link copied to clipboard

Adds listener for installation progress of a map.

Link copied to clipboard

Adds listener that will be called when a map that has resumed installation has finished installing.

Link copied to clipboard

Checks for map updates.

Link copied to clipboard
fun clearCache(listener: ResultListener)
Link copied to clipboard

Detects the country of current location.

Link copied to clipboard

Fetches all currently available maps. When finished, it calls the listener with the list of available map ISO codes or operation result if fetching failed.

Link copied to clipboard
fun getCountryDetails(mapIso: String, installed: Boolean, listener: MapCountryDetailsListener)

Fetch details about a country.

Link copied to clipboard
fun getMapStatus(mapIso: String, listener: MapStatusListener)

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

Link copied to clipboard
fun getRegionDetails(mapIso: String, installed: Boolean, listener: MapRegionDetailsListener)

Fetch details about a country region.

Link copied to clipboard
fun installMap(mapIso: String, networkSettings: NetworkSettings, listener: MapResultListener): MapInstaller.Task

Downloads and installs the requested map. If the installation progress should be reported, use the addMapProgressInstallListener function to register the corresponding listener.

Link copied to clipboard

Installs maps from root_path/offline_maps/update folder.

Link copied to clipboard
fun loadMap(mapIso: String, listener: MapResultListener)

Loads installed map (country or region).

Link copied to clipboard
fun loadMaps(mapIsos: List<String>, listener: MapsResultListener)

Loads installed maps (countries or regions).

Link copied to clipboard
Link copied to clipboard

Removes listener for installation progress of a map.

Link copied to clipboard

Removes listener for resumed map installation.

Link copied to clipboard

Resumes all pending map installations (and updates). If the notification about finished installation is needed, register listener for it via addMapResumedInstallDoneListener. If the installation progress should be reported, use the addMapProgressInstallListener function to register the corresponding listener.

Link copied to clipboard
fun setLocale(locale: String, listener: ResultListener)
Link copied to clipboard

Uninstalls the requested map.

Link copied to clipboard
fun unloadMap(mapIso: String, listener: MapResultListener)

Unloads loaded map.

Link copied to clipboard
fun unloadMaps(mapIsos: List<String>, listener: MapsResultListener)

Unloads loaded maps.

Link copied to clipboard
fun updateMap(mapIso: String, networkSettings: NetworkSettings, listener: MapResultListener): MapInstaller.Task

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