From 6ab97d2dfe563c2c43c2519b2e6f22494572045c Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Fri, 19 Jul 2024 10:50:06 +0100 Subject: Add network configuration windows in LearnMapKit --- LearnMapKit/ContentView.swift | 86 ++++++------------------------------------- 1 file changed, 11 insertions(+), 75 deletions(-) (limited to 'LearnMapKit/ContentView.swift') diff --git a/LearnMapKit/ContentView.swift b/LearnMapKit/ContentView.swift index 13ef64f..9f7fd29 100644 --- a/LearnMapKit/ContentView.swift +++ b/LearnMapKit/ContentView.swift @@ -9,6 +9,8 @@ import SwiftUI import MapKit import Collections + + struct FlightView: View { var evilClass: FlightState @@ -41,6 +43,7 @@ struct ContentView: View { @Binding var pos_queue: Deque @EnvironmentObject var evilClass: FlightState + @Environment(\.openWindow) private var openWindow let initialPosition: MapCameraPosition = { @@ -87,73 +90,6 @@ struct ContentView: View { //.padding() Map(initialPosition: initialPosition) { - /*Annotation("plane1", coordinate: position1) { - ZStack { - RoundedRectangle(cornerRadius: 10) - .fill(.background) - RoundedRectangle(cornerRadius: 10) - .stroke(.secondary,lineWidth: 5) - Image(systemName:"airplane.circle.fill") - .resizable() - .frame(width:20,height: 20) - } - }.annotationTitles(.hidden) - Annotation("plane2", coordinate: position2) { - ZStack { - RoundedRectangle(cornerRadius: 10) - .fill(.background) - RoundedRectangle(cornerRadius: 10) - .stroke(.secondary,lineWidth: 5) - Image(systemName:"airplane.circle.fill") - .resizable() - .frame(width:20,height: 20) - } - }.annotationTitles(.hidden) - Annotation("plane3", coordinate: position3) { - ZStack { - RoundedRectangle(cornerRadius: 10) - .fill(.background) - RoundedRectangle(cornerRadius: 10) - .stroke(.secondary,lineWidth: 5) - Image(systemName:"airplane.circle.fill") - .resizable() - .frame(width:20,height: 20) - } - }.annotationTitles(.hidden) - Annotation("plane4", coordinate: position4) { - ZStack { - RoundedRectangle(cornerRadius: 10) - .fill(.background) - RoundedRectangle(cornerRadius: 10) - .stroke(.secondary,lineWidth: 5) - Image(systemName:"airplane.circle.fill") - .resizable() - .frame(width:20,height: 20) - } - }.annotationTitles(.hidden)*//* - ForEach(0.. some View { - let c = self.evilClass.flight.count - ForEach(0..