diff --git a/StepMap/SearchItemView.swift b/StepMap/SearchItemView.swift index 9f9d112..5ad29c5 100644 --- a/StepMap/SearchItemView.swift +++ b/StepMap/SearchItemView.swift @@ -52,9 +52,18 @@ struct SearchItemView: View { Spacer() } HStack { - Text("\(location.placemark.locality ?? "")") - // .font(.) - .foregroundStyle(.gray) + VStack(alignment: .leading) { + if (location.placemark.thoroughfare != nil) { + Text( + "\(location.placemark.thoroughfare ?? "") \(location.placemark.subThoroughfare ?? "")" + ) + .foregroundStyle(.gray) + } + if (location.placemark.locality != nil) { + Text("\(location.placemark.locality ?? "")") + .foregroundStyle(.gray) + } + } Spacer() } } @@ -71,13 +80,13 @@ struct SearchItemView: View { } ) .frame(height: 100) -// .onAppear { -// findDirections() -// } + // .onAppear { + // findDirections() + // } } func formatDistance(distance: CLLocationDistance) -> String { - let steps = distance * (stepLength ?? 0) + let steps = distance / (stepLength ?? 1) if steps != 0 && showSteps { let formatter = NumberFormatter() formatter.maximumFractionDigits = 0 diff --git a/StepMap/SearchView.swift b/StepMap/SearchView.swift index 2c1e174..f256478 100644 --- a/StepMap/SearchView.swift +++ b/StepMap/SearchView.swift @@ -30,10 +30,10 @@ struct SearchView: View { self.locations = [] } } - // .onAppear { - // // TODO: delete this, it's for debug only - // search(for: self.query) - // } + // .onAppear { + // // TODO: delete this, it's for debug only + // search(for: self.query) + // } .overlay { HStack { Spacer()