fix(searchItem): fix step calculation and more info on location
This commit is contained in:
@@ -52,9 +52,18 @@ struct SearchItemView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
HStack {
|
HStack {
|
||||||
Text("\(location.placemark.locality ?? "")")
|
VStack(alignment: .leading) {
|
||||||
// .font(.)
|
if (location.placemark.thoroughfare != nil) {
|
||||||
|
Text(
|
||||||
|
"\(location.placemark.thoroughfare ?? "") \(location.placemark.subThoroughfare ?? "")"
|
||||||
|
)
|
||||||
.foregroundStyle(.gray)
|
.foregroundStyle(.gray)
|
||||||
|
}
|
||||||
|
if (location.placemark.locality != nil) {
|
||||||
|
Text("\(location.placemark.locality ?? "")")
|
||||||
|
.foregroundStyle(.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +86,7 @@ struct SearchItemView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func formatDistance(distance: CLLocationDistance) -> String {
|
func formatDistance(distance: CLLocationDistance) -> String {
|
||||||
let steps = distance * (stepLength ?? 0)
|
let steps = distance / (stepLength ?? 1)
|
||||||
if steps != 0 && showSteps {
|
if steps != 0 && showSteps {
|
||||||
let formatter = NumberFormatter()
|
let formatter = NumberFormatter()
|
||||||
formatter.maximumFractionDigits = 0
|
formatter.maximumFractionDigits = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user