diff options
author | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2024-07-02 10:07:49 +0100 |
---|---|---|
committer | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2024-07-02 10:07:49 +0100 |
commit | cc5272cd4be2ab55fa8411790082be408b586be9 (patch) | |
tree | 8436c54cdeb94e6383607fe0028b09a19790e8d2 /LearnMapKit/ContentView.swift | |
parent | 58d9d561df35f88884b2959d2cf322f1ee69e3cd (diff) | |
download | ADSBDecoder-cc5272cd4be2ab55fa8411790082be408b586be9.tar.gz ADSBDecoder-cc5272cd4be2ab55fa8411790082be408b586be9.zip |
Make ADSBDecoder more modular. Integrate into LearnMapKit
Diffstat (limited to 'LearnMapKit/ContentView.swift')
-rw-r--r-- | LearnMapKit/ContentView.swift | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/LearnMapKit/ContentView.swift b/LearnMapKit/ContentView.swift index d9e3377..08f4192 100644 --- a/LearnMapKit/ContentView.swift +++ b/LearnMapKit/ContentView.swift @@ -7,11 +7,15 @@ import SwiftUI import MapKit +import Collections struct ContentView: View { - @State private var region = MKCoordinateRegion() + @State private var isImporting = false + + @Binding var pos_queue: Deque<ADSBLocation> + @EnvironmentObject var evilClass: FlightState let initialPosition: MapCameraPosition = { let center = CLLocationCoordinate2D(latitude: 55.90159, longitude:-3.53154) @@ -49,6 +53,7 @@ struct ContentView: View { } Button("7") { print("Pressed 7") + print(evilClass.update_postions.count) } } .border(.blue) @@ -105,6 +110,22 @@ struct ContentView: View { .border(.green) .layoutPriority(1) .mapStyle(.hybrid(elevation: .realistic)) + .toolbar { + ToolbarItem() { + Button { + isImporting = true + } label: { + Label("Import file", systemImage: "square.and.arrow.down") + } + } + } .fileImporter(isPresented: $isImporting, allowedContentTypes: [.text], allowsMultipleSelection: false) { + result in switch result { + case .success(let files): + print(files) + case .failure(let error): + print(error) + } + } } @@ -114,6 +135,6 @@ struct ContentView: View { } } -#Preview { - ContentView() -} +//#Preview { + //ContentView(pos_queue: pos_queue) +//} |