mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Add stopped icon if the speed position flag is enabled and speed is < 1kph
This commit is contained in:
parent
41659ae8f5
commit
2d4d511c37
1 changed files with 10 additions and 5 deletions
|
|
@ -227,11 +227,6 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
if pf.contains(.SeqNo) {
|
||||
subtitle.text! += "Sequence: \(String(positionAnnotation.seqNo)) \n"
|
||||
}
|
||||
if pf.contains(.Speed) {
|
||||
let formatter = MeasurementFormatter()
|
||||
formatter.locale = Locale.current
|
||||
subtitle.text! += "Speed: \(formatter.string(from: Measurement(value: Double(positionAnnotation.speed), unit: UnitSpeed.kilometersPerHour))) \n"
|
||||
}
|
||||
if pf.contains(.Heading){
|
||||
|
||||
if parent.userTrackingMode != MKUserTrackingMode.followWithHeading {
|
||||
|
|
@ -241,7 +236,17 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
annotationView.glyphImage = UIImage(systemName: "flipphone")
|
||||
}
|
||||
}
|
||||
if pf.contains(.Speed) {
|
||||
let formatter = MeasurementFormatter()
|
||||
formatter.locale = Locale.current
|
||||
if positionAnnotation.speed <= 1 {
|
||||
annotationView.glyphImage = UIImage(systemName: "hexagon")
|
||||
}
|
||||
subtitle.text! += "Speed: \(formatter.string(from: Measurement(value: Double(positionAnnotation.speed), unit: UnitSpeed.kilometersPerHour))) \n"
|
||||
}
|
||||
|
||||
} else {
|
||||
// node metadata is nil
|
||||
annotationView.glyphImage = UIImage(systemName: "flipphone")
|
||||
}
|
||||
if LocationHelper.currentLocation.distance(from: LocationHelper.DefaultLocation) > 0.0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue