MapLoader

class MapLoader : NativeMethodsReceiver

Class providing functionality to manage offline maps on the device.

ToDo: Update documentation!

Types

LoadResult
Link copied to clipboard
enum LoadResult : Enum<MapLoader.LoadResult>
Result of executed operation.
MapStatus
Link copied to clipboard
enum MapStatus : Enum<MapLoader.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): MapLoader.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): MapLoader.Task
Detects the country of current location.
getAvailableCountries
Link copied to clipboard
fun getAvailableCountries(installed: Boolean, listener: MapListResultListener): MapLoader.Task
Fetches all currently available maps.
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): MapLoader.Task
Downloads and installs the requested map.
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: MapLoaderResumeInfoListener)
Resumes all pending map installations (and updates).
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): MapLoader.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): MapLoader.Task
Updates map with given ISO code.