mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-29 02:24:20 -04:00
Run clustering on Dispatchers.Default, not Dispatchers.IO
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user