Location cleanup

This commit is contained in:
Garth Vander Houwen 2023-12-10 12:38:01 -08:00
parent a30fc18d73
commit f2aea53ab6
4 changed files with 35 additions and 17 deletions

View file

@ -37,7 +37,7 @@ struct RouteRecorder: View {
@State var isShowingDetails = false
@State var timer: Timer?
@Namespace var namespace
@Namespace var mapscope
@Namespace var routerecorderscope
@State var timeElapsed: TimerDisplayObject = TimerDisplayObject()
@State var timerDisplay = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
@ -45,7 +45,7 @@ struct RouteRecorder: View {
VStack {
VStack {
VStack {
Map(position: $position, scope: mapscope) {
Map(position: $position, scope: routerecorderscope) {
UserAnnotation()
// ForEach(locations, id: \.id) { location in
// Marker(location.name, systemImage: location.icon, coordinate: location.location)
@ -53,6 +53,7 @@ struct RouteRecorder: View {
// }
}
}
.mapScope(routerecorderscope)
.mapControls {
MapUserLocationButton()
MapCompass()
@ -62,10 +63,6 @@ struct RouteRecorder: View {
.mapStyle(.hybrid(elevation: .realistic, showsTraffic: true))
.transition(.slide)
.mapControlVisibility(.visible)
.task {
print("this is running")
locationsHandler.startLocationUpdates()
}
.safeAreaInset(edge: .bottom) {
ZStack {
VStack {

View file

@ -313,7 +313,6 @@ struct Settings: View {
}
}
.onAppear {
selection = SettingsSidebar.about
if self.bleManager.context == nil {
self.bleManager.context = context
}