load

suspend fun load(context: Context, offlineLoad: Boolean = false, license: String? = null): Map

Downloads the 2D map file asynchronously.

This function is responsible for asynchronously downloading a 2D map file. It handles all the tasks related to downloading the map file and checks whether the file is already downloaded or not. The map can only be displayed after a successful download.

Return

The loaded map.

Parameters

context

The context used for loading the map.

offlineLoad

Determines whether to load the map offline or online. The default value is false.

license

The license for loading the map. The default value is null.

Throws

If the map service is not available or an error occurs during loading.


fun load(context: Context, offlineLoad: Boolean = false, license: String? = null, completionCallback: CompletionCallback<Map>)

Downloads the 2D map file asynchronously and provides a completion callback.

This function is responsible for asynchronously downloading a 2D map file. It handles all the tasks related to downloading the map file and checks whether the file is already downloaded or not. The map can only be displayed after a successful download.

Parameters

context

The context used for loading the map.

offlineLoad

Determines whether to load the map offline or online. Default is false.

license

The license for loading the map. Default is null.

completionCallback

The completion callback for handling the result or error.


fun load(context: Context, offlineLoad: Boolean = false, license: String? = null, onComplete: (Map) -> Unit, onProgress: (Int, Int, Int) -> Unit, onError: (Throwable) -> Unit)

Downloads the 2D map file asynchronously and provides callbacks for different events.

This function is responsible for asynchronously downloading a 2D map file. It handles all the tasks related to downloading the map file and checks whether the file is already downloaded or not. The map can only be displayed after a successful download.

Parameters

context

The context used for loading the map.

offlineLoad

Determines whether to load the map offline or online. Default is false.

license

The license for loading the map. Default is null.

onComplete

The callback to be invoked when the map is loaded successfully.

onProgress

The callback to be invoked during the loading progress.

onError

The callback to be invoked when an error occurs during the loading.