summaryrefslogtreecommitdiff
path: root/LearnMapKit/ContentView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'LearnMapKit/ContentView.swift')
-rw-r--r--LearnMapKit/ContentView.swift29
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)
+//}