Change location user tracking mode to use less battery

This commit is contained in:
Garth Vander Houwen 2023-01-12 10:51:51 -08:00
parent 1a80b47491
commit 93ff4b28bb
3 changed files with 5 additions and 3 deletions

View file

@ -42,7 +42,7 @@ extension PositionEntity {
}
extension PositionEntity: MKAnnotation {
public var coordinate: CLLocationCoordinate2D { nodeCoordinate ?? CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0) }
public var coordinate: CLLocationCoordinate2D { nodeCoordinate ?? LocationHelper.DefaultLocation }
public var title: String? { nodePosition?.user?.shortName ?? NSLocalizedString("unknown", comment: "Unknown") }
public var subtitle: String? { time?.formatted() }
}

View file

@ -32,7 +32,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
mapView.showsBuildings = true;
mapView.addAnnotations(positions)
mapView.showsUserLocation = true
mapView.setUserTrackingMode(.followWithHeading, animated: true)
mapView.setUserTrackingMode(.none, animated: false)
mapView.showsCompass = true
mapView.showsScale = true
mapView.isScrollEnabled = true

View file

@ -355,7 +355,9 @@ struct NodeDetail: View {
}
}
}
} }
}
.padding(5)
}
}
}
.edgesIgnoringSafeArea([.leading, .trailing])