mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Clean up form for position config
This commit is contained in:
parent
faf780a09a
commit
23f2fc5136
5 changed files with 8 additions and 16 deletions
|
|
@ -88,6 +88,7 @@ enum SenderIntervals: Int, CaseIterable, Identifiable {
|
|||
|
||||
enum UpdateIntervals: Int, CaseIterable, Identifiable {
|
||||
|
||||
case fiveSeconds = 5
|
||||
case tenSeconds = 10
|
||||
case fifteenSeconds = 15
|
||||
case thirtySeconds = 30
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
let userTrackingMode: MKUserTrackingMode
|
||||
let showNodeHistory: Bool
|
||||
let showRouteLines: Bool
|
||||
let showMultipleNodes: Bool
|
||||
@AppStorage("meshMapRecentering") private var recenter: Bool = false
|
||||
// Offline Map Tiles
|
||||
@AppStorage("lastUpdatedLocalMapFile") private var lastUpdatedLocalMapFile = 0
|
||||
|
|
@ -137,7 +136,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
var lineIndex = 0
|
||||
for position in latest {
|
||||
|
||||
let nodePositions = positions.filter { $0.time! >= Calendar.current.startOfDay(for: Date()) && $0.nodePosition?.num ?? 0 == position.nodePosition?.num ?? -1 }
|
||||
let nodePositions = positions.filter { $0.nodePosition?.num ?? 0 == position.nodePosition?.num ?? -1 }
|
||||
let lineCoords = nodePositions.map ({
|
||||
(position) -> CLLocationCoordinate2D in
|
||||
return position.nodeCoordinate!
|
||||
|
|
@ -154,15 +153,9 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
}
|
||||
if userTrackingMode == MKUserTrackingMode.none {
|
||||
mapView.showsUserLocation = false
|
||||
mapView.addAnnotations(showNodeHistory ? positions : latest)
|
||||
if recenter {
|
||||
if !showMultipleNodes {
|
||||
mapView.fit(annotations:showNodeHistory ? positions : latest, andShow: true)
|
||||
} else {
|
||||
mapView.addAnnotations(showNodeHistory ? positions : latest)
|
||||
mapView.fitAllAnnotations()
|
||||
}
|
||||
} else {
|
||||
mapView.addAnnotations(showNodeHistory ? positions : latest)
|
||||
mapView.fit(annotations:showNodeHistory || showRouteLines ? positions : latest, andShow: false)
|
||||
}
|
||||
} else {
|
||||
// Centering Done by tracking mode
|
||||
|
|
@ -362,7 +355,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
let index = Int(titleString.components(separatedBy: "-").last ?? "0")
|
||||
let renderer = MKPolylineRenderer(polyline: routePolyline)
|
||||
renderer.strokeColor = parent.lineColors[index ?? 0]
|
||||
renderer.lineWidth = 7
|
||||
renderer.lineWidth = 8
|
||||
return renderer
|
||||
}
|
||||
return MKOverlayRenderer()
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ struct NodeDetail: View {
|
|||
if node.positions?.count ?? 0 > 0 {
|
||||
ZStack {
|
||||
let positionArray = node.positions?.array as? [PositionEntity] ?? []
|
||||
let lastThousand = Array(positionArray.prefix(1000))
|
||||
let lastTenThousand = Array(positionArray.prefix(10000))
|
||||
// let todaysPositions = positionArray.filter { $0.time! >= Calendar.current.startOfDay(for: Date()) }
|
||||
ZStack {
|
||||
MapViewSwiftUI(onLongPress: { coord in
|
||||
|
|
@ -72,12 +72,11 @@ struct NodeDetail: View {
|
|||
editingWaypoint = wpId
|
||||
presentingWaypointForm = true
|
||||
}
|
||||
}, positions: lastThousand, waypoints: Array(waypoints),
|
||||
}, positions: lastTenThousand, waypoints: Array(waypoints),
|
||||
mapViewType: mapType,
|
||||
userTrackingMode: MKUserTrackingMode.none,
|
||||
showNodeHistory: meshMapShowNodeHistory,
|
||||
showRouteLines: meshMapShowRouteLines,
|
||||
showMultipleNodes: false,
|
||||
customMapOverlay: self.customMapOverlay
|
||||
)
|
||||
VStack(alignment: .leading) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ struct NodeMap: View {
|
|||
userTrackingMode: userTrackingMode,
|
||||
showNodeHistory: meshMapShowNodeHistory,
|
||||
showRouteLines: meshMapShowRouteLines,
|
||||
showMultipleNodes: true,
|
||||
customMapOverlay: self.customMapOverlay
|
||||
)
|
||||
VStack {
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ struct PositionConfig: View {
|
|||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
Text("The minimum distance change to be considered for a smart position broadcast.")
|
||||
Text("The minimum distance change in meters to be considered for a smart position broadcast.")
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue