diff --git a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift index 703ef890..48ff4ba1 100644 --- a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift +++ b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift @@ -123,7 +123,7 @@ struct NodeMapSwiftUI: View { .opacity(0.8) .presentationCompactAdaptation(.popover) } - + } else { Image(systemName: "flipphone") .symbolEffect(.pulse.byLayer) @@ -140,7 +140,7 @@ struct NodeMapSwiftUI: View { .opacity(0.8) .presentationCompactAdaptation(.popover) } - + } } else { if showNodeHistory { @@ -153,7 +153,7 @@ struct NodeMapSwiftUI: View { .clipShape(Circle()) .rotationEffect(headingDegrees) .frame(width: 16, height: 16) - + } else { Circle() .fill(Color(UIColor(hex: UInt32(node.num)))) @@ -282,8 +282,8 @@ struct NodeMapSwiftUI: View { showWaypoints = !showWaypoints } }) { - Image(systemName: showWaypoints ? "signpost.right.and.left.fill" : "signpost.right.and.left") - .padding(.vertical, 5) + Image(systemName: showWaypoints ? "signpost.right.and.left.fill" : "signpost.right.and.left") + .padding(.vertical, 5) } .tint(Color(UIColor.secondarySystemBackground)) .foregroundColor(.accentColor) @@ -319,13 +319,13 @@ struct NodeMapSwiftUI: View { .foregroundColor(.accentColor) .buttonStyle(.borderedProminent) } - #if targetEnvironment(macCatalyst) +#if targetEnvironment(macCatalyst) /// Hide non fuctional catalyst controls -// MapZoomStepper(scope: mapScope) -// .mapControlVisibility(.visible) -// MapPitchSlider(scope: mapScope) -// .mapControlVisibility(.visible) - #endif + // MapZoomStepper(scope: mapScope) + // .mapControlVisibility(.visible) + // MapPitchSlider(scope: mapScope) + // .mapControlVisibility(.visible) +#endif } .controlSize(.regular) .padding(5) diff --git a/Meshtastic/Views/Settings/Routes.swift b/Meshtastic/Views/Settings/Routes.swift index 43dfa543..2d64f42f 100644 --- a/Meshtastic/Views/Settings/Routes.swift +++ b/Meshtastic/Views/Settings/Routes.swift @@ -33,9 +33,8 @@ struct Routes: View { ) { result in do { guard let selectedFile: URL = try result.get().first else { return } - - guard selectedFile.startAccessingSecurityScopedResource() else { // Notice this line right here - return + guard selectedFile.startAccessingSecurityScopedResource() else { + return } do { @@ -79,7 +78,7 @@ struct Routes: View { print("Error: \(error.localizedDescription)") } } - + } catch { print("error: \(error)") // to do deal with errors } @@ -97,7 +96,7 @@ struct Routes: View { .listStyle(.plain) } .navigationTitle("Route List") - } detail: { + } detail: { VStack { if selectedRoute != nil { let locationArray = selectedRoute?.locations?.array as? [LocationEntity] ?? [] @@ -105,18 +104,31 @@ struct Routes: View { return location.locationCoordinate ?? LocationHelper.DefaultLocation }) - Map () { - - let gradient = LinearGradient( - colors: [.cyan, .blue, .secondary],//[Color(nodeColor.lighter().lighter()), Color(nodeColor.lighter()), Color(nodeColor)], - startPoint: .leading, endPoint: .trailing - ) + Map() { + Annotation("Start", coordinate: lineCoords.first ?? LocationHelper.DefaultLocation) { + ZStack { + Circle() + .fill(Color(.green)) + .strokeBorder(.white, lineWidth: 3) + .frame(width: 15, height: 15) + } + } + .annotationTitles(.automatic) + Annotation("Finish", coordinate: locationArray.last?.locationCoordinate ?? LocationHelper.DefaultLocation) { + ZStack { + Circle() + .fill(Color(.black)) + .strokeBorder(.white, lineWidth: 3) + .frame(width: 15, height: 15) + } + } + .annotationTitles(.automatic) let dashed = StrokeStyle( lineWidth: 3, - lineCap: .round, lineJoin: .round, dash: [10, 10] + lineCap: .round, lineJoin: .round, dash: [7, 10] ) MapPolyline(coordinates: lineCoords) - .stroke(gradient, style: dashed) + .stroke(.green, style: dashed) } .frame(maxWidth: .infinity, maxHeight: .infinity) } diff --git a/Meshtastic/Views/Settings/Settings.swift b/Meshtastic/Views/Settings/Settings.swift index 1694105e..2d21c447 100644 --- a/Meshtastic/Views/Settings/Settings.swift +++ b/Meshtastic/Views/Settings/Settings.swift @@ -62,7 +62,7 @@ struct Settings: View { NavigationLink { Routes() } label: { - Image(systemName: "gearshape") + Image(systemName: "road.lanes.curved.right") .symbolRenderingMode(.hierarchical) Text("routes") }