Run clustering on Dispatchers.Default, not Dispatchers.IO

This commit is contained in:
johan12345
2023-06-16 23:08:01 +02:00
parent 2ce82b961b
commit dd4fcc7550
2 changed files with 2 additions and 2 deletions

View File

@@ -867,7 +867,7 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac
if (BuildConfig.FLAVOR.contains("google") && mapFragment!!.priority[0] == MapFragment.GOOGLE) {
// Google Maps: icons can be generated in background thread
lifecycleScope.launch {
withContext(Dispatchers.IO) {
withContext(Dispatchers.Default) {
chargerIconGenerator.preloadCache()
}
}

View File

@@ -297,7 +297,7 @@ class ChargeLocationsRepository(
val clusterDistance = getClusterDistance(zoom)
val chargersClustered = if (useClustering && clusterDistance != null) {
Dispatchers.IO.run {
Dispatchers.Default.run {
cluster(chargers, zoom, clusterDistance)
}
} else chargers