MapServices
This module allows to implement map services to download or import additional map data.
Module MapServices
Dependencies
This module depends on other BeNomad's modules :
Error Manager
Core
BeMapAPI
SettingsManager
Other module's dependencies :
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
implementation "com.google.code.gson:gson:2.8.7"
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.appcompat:appcompat:1.4.1"
implementation "com.google.android.material:material:1.8.0"EVPOI Map Services
In order to interact with this class, you need to create an EVPOIMapServices Instance.
The authorization data needed to interact with this class will be automatically fetched from the license file. (See the Core documentation for more info about the licensing process)
The Core MUST be initialized before using this class.
import com.benomad.msdk.mapservices.EVPOIMapServices
...
// Replace with your provider
var provider= "provider_name"
// You must have write access to this folder
var destinationPath = Core.getInstance().getExternalScopedStoragePath(context!!)
// Initialize the service
var service = context?.let { it1 -> EVPOIMapServices(it1, object : MapServicesListener {
override fun onUpdateSuccess() {
Log.i(TAG, "EVPOI are downloaded and up to date")
}
override fun onUpdateError(error: Error) {
Log.e(TAG, error.messageId)
}
}, destinationPath, provider) }To download new files, update them, or load the currently downloaded files there is only one method.
// Load and update files
service?.loadAndUpdate()If you don't call this method, even if the map data is already downloaded it won't be loaded. If there is not internet connection it'll still load the map data.