Skip to content

Commit 7407e6a

Browse files
committed
updated passing cluster manager to reload function
1 parent fec4141 commit 7407e6a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

GoInfoGame/GoInfoGame/UI/Map/CustomMap.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ struct CustomMap: UIViewRepresentable {
165165
self.coordinator = coordinator
166166
}
167167

168-
func reload(using mapView: MKMapView?, clusterManager: ClusterManager<DisplayUnitAnnotation>) {
168+
func reload(using mapView: MKMapView?) {
169169
// Cancel the old reload if it's still running
170170
currentTask?.cancel()
171171

172172
currentTask = Task {
173173
guard let mapView = mapView else { return }
174-
async let changes = clusterManager.reload(
174+
async let changes = coordinator.clusterManager.reload(
175175
mapViewSize: mapView.bounds.size,
176176
coordinateRegion: mapView.region
177177
)
@@ -425,7 +425,7 @@ struct CustomMap: UIViewRepresentable {
425425

426426
func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) {
427427
Task {
428-
await mapReloader.reload(using: mapView, clusterManager: clusterManager)
428+
await mapReloader.reload(using: mapView)
429429
}
430430
}
431431

@@ -543,7 +543,7 @@ struct CustomMap: UIViewRepresentable {
543543
private func manageAnnotations(_ mapView: MKMapView, context: Context) async {
544544

545545
await context.coordinator.clusterManager.removeAll()
546-
await context.coordinator.mapReloader.reload(using: mapView, clusterManager: context.coordinator.clusterManager)
546+
await context.coordinator.mapReloader.reload(using: mapView)
547547
// let existingCoordinates = mapView.annotations.compactMap {
548548
// ($0 as? DisplayUnitAnnotation)?.coordinate
549549
// }
@@ -565,7 +565,7 @@ struct CustomMap: UIViewRepresentable {
565565
.filter { !$0.isHidden }
566566
.map { $0.annotation }
567567
await context.coordinator.clusterManager.add(visibleAnnotations)
568-
await context.coordinator.mapReloader.reload(using: mapView, clusterManager: context.coordinator.clusterManager)
568+
await context.coordinator.mapReloader.reload(using: mapView)
569569
}
570570

571571
func adjustCoordinateForOverlap(_ coordinate: CLLocationCoordinate2D, with index: Int) -> CLLocationCoordinate2D {

0 commit comments

Comments
 (0)