diff options
Diffstat (limited to 'iosApp/iosApp/Map/MapView.swift')
-rw-r--r-- | iosApp/iosApp/Map/MapView.swift | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/iosApp/iosApp/Map/MapView.swift b/iosApp/iosApp/Map/MapView.swift index f9757f4..e52c034 100644 --- a/iosApp/iosApp/Map/MapView.swift +++ b/iosApp/iosApp/Map/MapView.swift @@ -28,8 +28,6 @@ struct MapView: UIViewControllerRepresentable { @Binding var selected: Marker? var markerCallback: MarkerCallback? - var shouldCenter = true - class Coordinator { var shouldCenter: Bool = true var oldMarkers: [Marker] = [] @@ -52,11 +50,12 @@ struct MapView: UIViewControllerRepresentable { // MARK: - Set markers if context.coordinator.oldMarkers != markers { + print("center = \(context.coordinator.shouldCenter)") uiViewController.display(markers: markers, isReport: false, center: context.coordinator.shouldCenter) + context.coordinator.shouldCenter = false } - context.coordinator.shouldCenter = false context.coordinator.oldMarkers = markers // MARK: - Center selected marker |