mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Add distance from current location to annotation detail
This commit is contained in:
parent
8768b658bf
commit
b630821f10
1 changed files with 2 additions and 0 deletions
|
|
@ -242,6 +242,8 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
} else {
|
||||
annotationView.glyphImage = UIImage(systemName: "flipphone")
|
||||
}
|
||||
let metersAway = positionAnnotation.coordinate.distance(from: LocationHelper.currentLocation)
|
||||
subtitle.text! += NSLocalizedString("distance", comment: "") + ": \(distanceFormatter.string(fromDistance: Double(metersAway))) \n"
|
||||
subtitle.text! += positionAnnotation.time?.formatted() ?? "Unknown \n"
|
||||
subtitle.numberOfLines = 0
|
||||
annotationView.detailCalloutAccessoryView = subtitle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue