Merge pull request #1255 from RCGV1/waypoint-my-location-button

Seperated button
This commit is contained in:
Benjamin Faershtein 2025-06-12 14:22:47 -07:00 committed by GitHub
commit 85abbb058e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -33445,6 +33445,9 @@
}
}
}
},
"Use my Location" : {
},
"Use Preset" : {
"localizations" : {

View file

@ -49,15 +49,18 @@ struct WaypointForm: View {
.foregroundColor(.secondary)
.font(.caption)
}
Button {
let currentLoc = LocationsHandler.currentLocation
waypoint.coordinate.longitude = currentLoc.longitude
waypoint.coordinate.latitude = currentLoc.latitude
} label: {
Image(systemName: "location")
HStack {
Text("Use my Location")
Image(systemName: "location")
}
}
.accessibilityLabel("Set to current location")
}
HStack {
if waypoint.coordinate.latitude != 0 && waypoint.coordinate.longitude != 0 {
DistanceText(meters: distance)