MapInstaller

Class providing functionality to manage offline maps on the device.

ToDo: Update documentation!

Types

Link copied to clipboard
enum LoadResult : Enum<MapInstaller.LoadResult>

Result of executed operation.

Link copied to clipboard
enum MapStatus : Enum<MapInstaller.MapStatus>

Status of a map.

Link copied to clipboard
class Task

Class responsible for cancelling the running operation it represents.

Functions

Link copied to clipboard
fun addMapProgressInstallListener(listener: MapInstallProgressListener, executor: Executor? = null)

Adds listener for installation progress of a map.

Link copied to clipboard
fun addMapResumedInstallDoneListener(listener: MapResumedInstallDoneListener, executor: Executor? = null)

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

Link copied to clipboard
open fun <T : NativeMethodsReceiver.NativeListener> callMethod(clazz: Class<T>, callback: NativeMethodsReceiver.NativeCallback<T>)
Link copied to clipboard
fun checkForUpdates(listener: MapListResultListener): MapInstaller.Task

Checks for map updates.

Link copied to clipboard
fun clearCache(listener: ResultListener)
Link copied to clipboard
fun detectCurrentCountry(mapIso: String = "", listener: MapResultListener): MapInstaller.Task

Detects the country of current location.

Link copied to clipboard
fun getAvailableCountries(installed: Boolean, listener: MapListResultListener): MapInstaller.Task

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
open fun <T : NativeMethodsReceiver.NativeListener> getListeners(clazz: Class<T>): MutableMap<T, Executor>
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, 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
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
open override fun onContextDestroy()
Link copied to clipboard
open fun <T : NativeMethodsReceiver.NativeListener> register(clazz: Class<T>, listener: T): Int
open fun <T : NativeMethodsReceiver.NativeListener> register(    clazz: Class<T>,     listener: T,     @Nullable executor: Executor?): Int
Link copied to clipboard
fun removeMapProgressInstallListener(listener: MapInstallProgressListener)

Removes listener for installation progress of a map.

Link copied to clipboard
fun removeMapResumedInstallDoneListener(listener: MapResumedInstallDoneListener)

Removes listener for resumed map installation.

Link copied to clipboard
fun resumePendingInstallations(listener: MapInstallerResumeInfoListener)

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
open fun size(): Int
Link copied to clipboard
fun uninstallMap(mapIso: String, listener: MapResultListener): MapInstaller.Task

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
open fun <T : NativeMethodsReceiver.NativeListener> unregister(clazz: Class<T>, listener: T): Int
Link copied to clipboard
fun updateMap(mapIso: String, 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.