diff options
Diffstat (limited to 'iosApp/iosApp/Map')
-rw-r--r-- | iosApp/iosApp/Map/MapView.swift | 5 | ||||
-rw-r--r-- | iosApp/iosApp/Map/MapViewController.swift | 4 | ||||
-rw-r--r-- | iosApp/iosApp/Map/MapViewController.xib | 10 |
3 files changed, 14 insertions, 5 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 diff --git a/iosApp/iosApp/Map/MapViewController.swift b/iosApp/iosApp/Map/MapViewController.swift index bc793e2..131a511 100644 --- a/iosApp/iosApp/Map/MapViewController.swift +++ b/iosApp/iosApp/Map/MapViewController.swift @@ -77,7 +77,7 @@ class MapViewController: UIViewController { func display(markers: [Marker], isReport: Bool, center: Bool = false) { - DispatchQueue.main.async { + mapView.runOnInit { self.mapView.display(markers: markers, isReport: isReport, center: center) @@ -85,7 +85,7 @@ class MapViewController: UIViewController { } func focusOn(marker: Marker) { - DispatchQueue.main.async { + mapView.runOnInit { self.mapView.focusOn(marker: marker) } } diff --git a/iosApp/iosApp/Map/MapViewController.xib b/iosApp/iosApp/Map/MapViewController.xib index 9d1694f..305a15b 100644 --- a/iosApp/iosApp/Map/MapViewController.xib +++ b/iosApp/iosApp/Map/MapViewController.xib @@ -35,6 +35,11 @@ <imageReference key="image" image="plus" catalog="system" symbolScale="large"/> <preferredSymbolConfiguration key="preferredSymbolConfiguration"/> </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> + <integer key="value" value="10"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> <connections> <action selector="onZoomInPressed:" destination="-1" eventType="touchUpInside" id="x4P-sk-jdi"/> </connections> @@ -54,6 +59,11 @@ <imageReference key="image" image="minus" catalog="system" symbolScale="large"/> <preferredSymbolConfiguration key="preferredSymbolConfiguration"/> </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> + <integer key="value" value="10"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> <connections> <action selector="onZoomOutPressed:" destination="-1" eventType="touchUpInside" id="rt2-fy-VCy"/> </connections> |