diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index e078d344..7e342fb5 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -280,11 +280,7 @@ isa = PBXGroup; children = ( C9A7BC0E27759A6800760B50 /* Custom */, - C9A88B54278B503C00BD810A /* MapViewModule.swift */, - C9697F9C279336B700250207 /* LocalMBTileOverlay.swift */, - DD2AD8A7296D2DF9001FF0E7 /* MapViewSwiftUI.swift */, DD964FBE296E76EF007C176F /* WaypointFormView.swift */, - DD964FC32974767D007C176F /* MapViewFitExtension.swift */, ); path = Map; sourceTree = ""; @@ -292,6 +288,10 @@ C9A7BC0E27759A6800760B50 /* Custom */ = { isa = PBXGroup; children = ( + C9697F9C279336B700250207 /* LocalMBTileOverlay.swift */, + DD964FC32974767D007C176F /* MapViewFitExtension.swift */, + DD2AD8A7296D2DF9001FF0E7 /* MapViewSwiftUI.swift */, + C9A88B54278B503C00BD810A /* MapViewModule.swift */, C9A7BC0F27759A9600760B50 /* PositionAnnotationView.swift */, ); path = Custom; diff --git a/Meshtastic/Views/Map/LocalMBTileOverlay.swift b/Meshtastic/Views/Map/Custom/LocalMBTileOverlay.swift similarity index 100% rename from Meshtastic/Views/Map/LocalMBTileOverlay.swift rename to Meshtastic/Views/Map/Custom/LocalMBTileOverlay.swift diff --git a/Meshtastic/Views/Map/MapViewFitExtension.swift b/Meshtastic/Views/Map/Custom/MapViewFitExtension.swift similarity index 100% rename from Meshtastic/Views/Map/MapViewFitExtension.swift rename to Meshtastic/Views/Map/Custom/MapViewFitExtension.swift diff --git a/Meshtastic/Views/Map/MapViewModule.swift b/Meshtastic/Views/Map/Custom/MapViewModule.swift similarity index 100% rename from Meshtastic/Views/Map/MapViewModule.swift rename to Meshtastic/Views/Map/Custom/MapViewModule.swift diff --git a/Meshtastic/Views/Map/MapViewSwiftUI.swift b/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift similarity index 100% rename from Meshtastic/Views/Map/MapViewSwiftUI.swift rename to Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift diff --git a/Meshtastic/Views/Map/Custom/PositionAnnotationView.swift b/Meshtastic/Views/Map/Custom/PositionAnnotationView.swift index 3c3e0f79..cfb843c3 100644 --- a/Meshtastic/Views/Map/Custom/PositionAnnotationView.swift +++ b/Meshtastic/Views/Map/Custom/PositionAnnotationView.swift @@ -1,60 +1,60 @@ +//// +//// PositionAnnotationView.swift +//// MeshtasticApple +//// +//// Created by Joshua Pirihi on 24/12/21. +//// // -// PositionAnnotationView.swift -// MeshtasticApple +//import UIKit +//import MapKit +//import SwiftUI // -// Created by Joshua Pirihi on 24/12/21. +//// a simple circle annotation, with a string in it +//class PositionAnnotation: NSObject, MKAnnotation { // - -import UIKit -import MapKit -import SwiftUI - -// a simple circle annotation, with a string in it -class PositionAnnotation: NSObject, MKAnnotation { - - // This property must be key-value observable, which the `@objc dynamic` attributes provide. - @objc dynamic var coordinate = CLLocationCoordinate2D(latitude: 0, longitude: 0) - - // Required if you set the annotation view's `canShowCallout` property to `true` - // this string fills the callout label when you tap an annotation - var title: String? - - // the text to appear inside the little circle - var shortName: String? - -} - -class PositionAnnotationView: MKAnnotationView { - - private let annotationFrame = CGRect(x: 0, y: 0, width: 40, height: 40) - private let label: UILabel - - override init(annotation: MKAnnotation?, reuseIdentifier: String?) { - self.label = UILabel(frame: annotationFrame.offsetBy(dx: 0, dy: 0)) - super.init(annotation: annotation, reuseIdentifier: reuseIdentifier) - self.frame = annotationFrame - self.label.font = UIFont.preferredFont(forTextStyle: .caption2) - self.label.textColor = .white - self.label.textAlignment = .center - self.backgroundColor = .clear - self.addSubview(label) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) not implemented!") - } - - public var name: String = "" { - didSet { - self.label.text = name - } - } - - override func draw(_ rect: CGRect) { - guard let context = UIGraphicsGetCurrentContext() else { return } - - let circleRect = CGRect(x: 1, y: 1, width: 38, height: 38) - context.setFillColor(Color.accentColor.cgColor ?? CGColor(red: 0, green: 0.5, blue: 1.0, alpha: 1.0)) - context.fillEllipse(in: circleRect) - } -} +// // This property must be key-value observable, which the `@objc dynamic` attributes provide. +// @objc dynamic var coordinate = CLLocationCoordinate2D(latitude: 0, longitude: 0) +// +// // Required if you set the annotation view's `canShowCallout` property to `true` +// // this string fills the callout label when you tap an annotation +// var title: String? +// +// // the text to appear inside the little circle +// var shortName: String? +// +//} +// +//class PositionAnnotationView: MKAnnotationView { +// +// private let annotationFrame = CGRect(x: 0, y: 0, width: 40, height: 40) +// private let label: UILabel +// +// override init(annotation: MKAnnotation?, reuseIdentifier: String?) { +// self.label = UILabel(frame: annotationFrame.offsetBy(dx: 0, dy: 0)) +// super.init(annotation: annotation, reuseIdentifier: reuseIdentifier) +// self.frame = annotationFrame +// self.label.font = UIFont.preferredFont(forTextStyle: .caption2) +// self.label.textColor = .white +// self.label.textAlignment = .center +// self.backgroundColor = .clear +// self.addSubview(label) +// } +// +// required init?(coder aDecoder: NSCoder) { +// fatalError("init(coder:) not implemented!") +// } +// +// public var name: String = "" { +// didSet { +// self.label.text = name +// } +// } +// +// override func draw(_ rect: CGRect) { +// guard let context = UIGraphicsGetCurrentContext() else { return } +// +// let circleRect = CGRect(x: 1, y: 1, width: 38, height: 38) +// context.setFillColor(Color.accentColor.cgColor ?? CGColor(red: 0, green: 0.5, blue: 1.0, alpha: 1.0)) +// context.fillEllipse(in: circleRect) +// } +//}