mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
More cleanup for maps and waypoints
This commit is contained in:
parent
f1d70a4103
commit
a6c4f0639e
4 changed files with 12 additions and 5 deletions
|
|
@ -80,8 +80,10 @@ class LocationHelper: NSObject, ObservableObject {
|
|||
|
||||
super.init()
|
||||
locationManager.delegate = self
|
||||
locationManager.desiredAccuracy = kCLLocationAccuracyBest
|
||||
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
|
||||
locationManager.pausesLocationUpdatesAutomatically = true
|
||||
locationManager.allowsBackgroundLocationUpdates = true
|
||||
locationManager.activityType = .otherNavigation
|
||||
locationManager.requestWhenInUseAuthorization()
|
||||
locationManager.startUpdatingLocation()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
|
||||
}
|
||||
annotationView.clusteringIdentifier = "waypointGroup"
|
||||
annotationView.markerTintColor = UIColor(.green)
|
||||
annotationView.markerTintColor = UIColor(.indigo)
|
||||
annotationView.titleVisibility = .visible
|
||||
return annotationView
|
||||
default: return nil
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ struct NodeDetail: View {
|
|||
let annotations = node.positions?.array as! [PositionEntity]
|
||||
ZStack {
|
||||
MapViewSwiftUI(onMarkerTap: { coord in
|
||||
presentingWaypointForm = true
|
||||
waypointCoordinate = coord
|
||||
presentingWaypointForm = true
|
||||
}, positions: annotations, waypoints: Array(waypoints), region: MKCoordinateRegion(center: nodeCoordinatePosition, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005)), mapViewType: mapType,
|
||||
customMapOverlay: self.customMapOverlay,
|
||||
overlays: self.overlays
|
||||
|
|
|
|||
|
|
@ -51,9 +51,14 @@ struct NodeMap: View {
|
|||
ZStack {
|
||||
|
||||
MapViewSwiftUI(onMarkerTap: { coord in
|
||||
presentingWaypointForm = true
|
||||
waypointCoordinate = coord
|
||||
}, positions: Array(positions), waypoints: Array(waypoints), region: MKCoordinateRegion(center: LocationHelper.currentLocation, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005)), mapViewType: mapType,
|
||||
if waypointCoordinate?.latitude ?? LocationHelper.DefaultLocation.latitude == LocationHelper.DefaultLocation.latitude {
|
||||
presentingWaypointForm = false
|
||||
} else {
|
||||
presentingWaypointForm = true
|
||||
}
|
||||
|
||||
}, positions: Array(positions), waypoints: Array(waypoints), region: MKCoordinateRegion(center: LocationHelper.currentLocation, span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01)), mapViewType: mapType,
|
||||
customMapOverlay: self.customMapOverlay,
|
||||
overlays: self.overlays
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue