From 74e7ac5dd80fbe2b1d058f8c1079b32bd7efd06f Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 24 Mar 2023 23:06:34 -0700 Subject: [PATCH] Update initial map centering --- Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift b/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift index 91f841b1..ed4a8695 100644 --- a/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift +++ b/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift @@ -43,13 +43,6 @@ struct MapViewSwiftUI: UIViewRepresentable { let center = (latest.count > 0 && userTrackingMode == MKUserTrackingMode.none) ? latest[0].coordinate : LocationHelper.currentLocation let region = MKCoordinateRegion(center: center, span: span) mapView.setRegion(region, animated: true) - // Set user (phone gps) tracking options - mapView.setUserTrackingMode(userTrackingMode, animated: true) - if userTrackingMode == MKUserTrackingMode.none { - mapView.showsUserLocation = false - } else { - mapView.showsUserLocation = true - } mapView.addAnnotations(showNodeHistory ? positions : latest) // Set user (phone gps) tracking options mapView.setUserTrackingMode(userTrackingMode, animated: true) @@ -59,7 +52,6 @@ struct MapViewSwiftUI: UIViewRepresentable { } else { mapView.showsUserLocation = true } - mapView.addAnnotations(showNodeHistory ? positions : latest) // Other MKMapView Settings mapView.preferredConfiguration.elevationStyle = .realistic// .flat mapView.isPitchEnabled = true @@ -125,6 +117,7 @@ struct MapViewSwiftUI: UIViewRepresentable { .sorted { $0.nodePosition?.num ?? 0 > $1.nodePosition?.num ?? -1 } let annotationCount = waypoints.count + (showNodeHistory || showRouteLines ? positions.count : latest.count) if annotationCount > mapView.annotations.count { + print("Annotation Count: \(annotationCount) Map Annotations: \(mapView.annotations.count)") if showRouteLines { // Remove all existing PolyLine Overlays for overlay in mapView.overlays {