MapInstaller

class MapInstaller : NativeMethodsReceiver

Class providing functionality to manage offline maps on the device.

ToDo: Update documentation!

Types

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

Result of executed operation.

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

Status of a map.

Task
Link copied to clipboard
class Task

Class responsible for cancelling the running operation it represents.

Functions

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

Adds listener for installation progress of a map.

addMapResumedInstallDoneListener
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.

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

Checks for map updates.

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

Detects the country of current location.

getAvailableCountries
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.

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

Fetch details about a country.

getListeners
Link copied to clipboard
open fun <T : NativeMethodsReceiver.NativeListener> getListeners(clazz: Class<T>): MutableMap<T, Executor>
getMapStatus
Link copied to clipboard
fun getMapStatus(mapIso: String, listener: MapStatusListener)

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

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

Fetch details about a country region.

installMap
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.

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

Loads installed map (country or region).

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

Loads installed maps (countries or regions).

register
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
removeMapProgressInstallListener
Link copied to clipboard
fun removeMapProgressInstallListener(listener: MapInstallProgressListener)

Removes listener for installation progress of a map.

removeMapResumedInstallDoneListener
Link copied to clipboard
fun removeMapResumedInstallDoneListener(listener: MapResumedInstallDoneListener)

Removes listener for resumed map installation.

resumePendingInstallations
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.

setLocale
Link copied to clipboard
fun setLocale(locale: String, listener: ResultListener)
size
Link copied to clipboard
open fun size(): Int
uninstallMap
Link copied to clipboard
fun uninstallMap(mapIso: String, listener: MapResultListener): MapInstaller.Task

Uninstalls the requested map.

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

Unloads loaded map.

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

Unloads loaded maps.

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