fix(search): only calculate route when user clicks on the search result

This commit is contained in:
2024-11-27 15:52:28 +01:00
parent 0e764b4238
commit 93b17fcc4f
2 changed files with 7 additions and 3 deletions

View File

@@ -32,6 +32,10 @@ struct ContentView: View {
// show how long does the route take with said walking speed
// Add favorite locations - like home, work, etc (probably should be stored in core data tho:/)
// How to speed up?
// calculate only the distance between the start and end instead of getting directions for everything
// if user clicks on the place, display better view and then calculate route there
var body: some View {
Map(position: $position) {
ForEach(0..<directions.count) { i in

View File

@@ -70,9 +70,9 @@ struct SearchItemView: View {
}
)
.frame(height: 100)
.onAppear {
findDirections()
}
// .onAppear {
// findDirections()
// }
}
func formatDistance(distance: CLLocationDistance) -> String {