aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Map/MapView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Map/MapView.swift')
-rw-r--r--iosApp/iosApp/Map/MapView.swift11
1 files changed, 11 insertions, 0 deletions
diff --git a/iosApp/iosApp/Map/MapView.swift b/iosApp/iosApp/Map/MapView.swift
index 6b0fa20..989f17a 100644
--- a/iosApp/iosApp/Map/MapView.swift
+++ b/iosApp/iosApp/Map/MapView.swift
@@ -25,6 +25,7 @@ struct MapView: UIViewControllerRepresentable {
@Binding var layer: MapLayer
@Binding var markers: [Marker]
+ @Binding var selected: Marker?
var markerCallback: MarkerCallback?
class Coordinator {
@@ -51,5 +52,15 @@ struct MapView: UIViewControllerRepresentable {
isReport: false,
center: context.coordinator.shouldCenter)
context.coordinator.shouldCenter = false
+
+ // MARK: - Center selected marker
+ if let selected = selected {
+ uiViewController.focusOn(marker: selected)
+ self.selected = nil
+ }
+ }
+
+ static func dismantleUIViewController(_ uiViewController: MapViewController, coordinator: Coordinator) {
+ uiViewController.dismantle()
}
}