diff --git a/Meshtastic/Helpers/LocationHelper.swift b/Meshtastic/Helpers/LocationHelper.swift index dab6637d..2d1c7a85 100644 --- a/Meshtastic/Helpers/LocationHelper.swift +++ b/Meshtastic/Helpers/LocationHelper.swift @@ -80,8 +80,10 @@ class LocationHelper: NSObject, ObservableObject { super.init() locationManager.delegate = self - locationManager.desiredAccuracy = kCLLocationAccuracyBest + locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters + locationManager.pausesLocationUpdatesAutomatically = true locationManager.allowsBackgroundLocationUpdates = true + locationManager.activityType = .otherNavigation locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } diff --git a/Meshtastic/Views/Map/MapViewSwiftUI.swift b/Meshtastic/Views/Map/MapViewSwiftUI.swift index 113ed20b..6f085198 100644 --- a/Meshtastic/Views/Map/MapViewSwiftUI.swift +++ b/Meshtastic/Views/Map/MapViewSwiftUI.swift @@ -166,7 +166,7 @@ struct MapViewSwiftUI: UIViewRepresentable { } annotationView.clusteringIdentifier = "waypointGroup" - annotationView.markerTintColor = UIColor(.green) + annotationView.markerTintColor = UIColor(.indigo) annotationView.titleVisibility = .visible return annotationView default: return nil diff --git a/Meshtastic/Views/Nodes/NodeDetail.swift b/Meshtastic/Views/Nodes/NodeDetail.swift index 4d0e89b0..e7f54145 100644 --- a/Meshtastic/Views/Nodes/NodeDetail.swift +++ b/Meshtastic/Views/Nodes/NodeDetail.swift @@ -45,8 +45,8 @@ struct NodeDetail: View { let annotations = node.positions?.array as! [PositionEntity] ZStack { MapViewSwiftUI(onMarkerTap: { coord in - presentingWaypointForm = true waypointCoordinate = coord + presentingWaypointForm = true }, positions: annotations, waypoints: Array(waypoints), region: MKCoordinateRegion(center: nodeCoordinatePosition, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005)), mapViewType: mapType, customMapOverlay: self.customMapOverlay, overlays: self.overlays diff --git a/Meshtastic/Views/Nodes/NodeMap.swift b/Meshtastic/Views/Nodes/NodeMap.swift index 7f5498a7..44003ba7 100644 --- a/Meshtastic/Views/Nodes/NodeMap.swift +++ b/Meshtastic/Views/Nodes/NodeMap.swift @@ -51,9 +51,14 @@ struct NodeMap: View { ZStack { MapViewSwiftUI(onMarkerTap: { coord in - presentingWaypointForm = true waypointCoordinate = coord - }, positions: Array(positions), waypoints: Array(waypoints), region: MKCoordinateRegion(center: LocationHelper.currentLocation, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005)), mapViewType: mapType, + if waypointCoordinate?.latitude ?? LocationHelper.DefaultLocation.latitude == LocationHelper.DefaultLocation.latitude { + presentingWaypointForm = false + } else { + presentingWaypointForm = true + } + + }, positions: Array(positions), waypoints: Array(waypoints), region: MKCoordinateRegion(center: LocationHelper.currentLocation, span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01)), mapViewType: mapType, customMapOverlay: self.customMapOverlay, overlays: self.overlays )