Finally got to the bottom of the Mesh Map not updating bug!

This commit is contained in:
Ben Meadors 2023-09-01 07:11:49 -05:00
parent 4a0ba0f7fc
commit 7feaa7dd9c

View file

@ -251,18 +251,17 @@ struct MapViewSwiftUI: UIViewRepresentable {
mapView.removeAnnotations(mapView.annotations)
mapView.addAnnotations(waypoints)
}
mapView.addAnnotations(showNodeHistory ? positions : latest)
if userTrackingMode == MKUserTrackingMode.none {
mapView.showsUserLocation = false
if UserDefaults.enableMapRecentering {
if latest.count == 1 {
mapView.fit(annotations: showNodeHistory ? positions : latest, andShow: true)
} else {
mapView.addAnnotations(showNodeHistory ? positions : latest)
mapView.fitAllAnnotations()
}
}
} else {
mapView.addAnnotations(showNodeHistory ? positions : latest)
mapView.showsUserLocation = true
}
mapView.setUserTrackingMode(userTrackingMode, animated: true)