diff --git a/Meshtastic/Model/UserSettings.swift b/Meshtastic/Model/UserSettings.swift index 2ccecdb8..e7c4846d 100644 --- a/Meshtastic/Model/UserSettings.swift +++ b/Meshtastic/Model/UserSettings.swift @@ -59,7 +59,7 @@ class UserSettings: ObservableObject { self.provideLocation = UserDefaults.standard.object(forKey: "provideLocation") as? Bool ?? false self.provideLocationInterval = UserDefaults.standard.object(forKey: "provideLocationInterval") as? Int ?? 900 self.keyboardType = UserDefaults.standard.object(forKey: "keyboardType") as? Int ?? 0 - self.meshMapType = UserDefaults.standard.string(forKey: "meshMapType") ?? "hybridFlyover" + self.meshMapType = UserDefaults.standard.string(forKey: "meshMapType") ?? "standard" self.meshMapCustomTileServer = UserDefaults.standard.string(forKey: "meshMapCustomTileServer") ?? "" } } diff --git a/Meshtastic/Views/Nodes/NodeDetail.swift b/Meshtastic/Views/Nodes/NodeDetail.swift index a73b0254..97785de0 100644 --- a/Meshtastic/Views/Nodes/NodeDetail.swift +++ b/Meshtastic/Views/Nodes/NodeDetail.swift @@ -13,6 +13,7 @@ struct NodeDetail: View { @Environment(\.managedObjectContext) var context @EnvironmentObject var bleManager: BLEManager @Environment(\.colorScheme) var colorScheme: ColorScheme + @AppStorage("meshMapType") private var meshMapType = "standard" @State private var mapType: MKMapType = .standard @State var waypointCoordinate: CLLocationCoordinate2D? @State var editingWaypoint: Int = 0 @@ -435,6 +436,28 @@ struct NodeDetail: View { }) .onAppear { self.bleManager.context = context + switch meshMapType { + case "standard": + mapType = .standard + break + case "mutedStandard": + mapType = .mutedStandard + break + case "hybrid": + mapType = .hybrid + break + case "hybridFlyover": + mapType = .hybridFlyover + break + case "satellite": + mapType = .satellite + break + case "satelliteFlyover": + mapType = .satelliteFlyover + break + default: + mapType = .hybridFlyover + } } .task(id: node.num) { do { diff --git a/Meshtastic/Views/Nodes/NodeMap.swift b/Meshtastic/Views/Nodes/NodeMap.swift index 043be960..45fa6765 100644 --- a/Meshtastic/Views/Nodes/NodeMap.swift +++ b/Meshtastic/Views/Nodes/NodeMap.swift @@ -29,7 +29,7 @@ struct NodeMap: View { } } } - @AppStorage("meshMapType") private var meshMapType = "standard" + @AppStorage("meshMapType") private var meshMapType = "hybridFlyover" //&& nodePosition != nil @FetchRequest(sortDescriptors: [NSSortDescriptor(key: "time", ascending: true)], @@ -42,7 +42,7 @@ struct NodeMap: View { ), animation: .none) private var waypoints: FetchedResults - @State private var mapType: MKMapType = .hybridFlyover + @State private var mapType: MKMapType = .standard @State var waypointCoordinate: CLLocationCoordinate2D = LocationHelper.DefaultLocation @State var editingWaypoint: Int = 0 @State private var presentingWaypointForm = false