From 92e3a2aa9f1f8a9a72a7f672a9ceefa43689fbb3 Mon Sep 17 00:00:00 2001 From: oliverhnat Date: Mon, 25 Nov 2024 14:49:55 +0100 Subject: [PATCH] feat(route): display route on the map --- StepMap/ContentView.swift | 40 +++++++++++++++++++++++++++------------ StepMap/SearchView.swift | 8 ++++---- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/StepMap/ContentView.swift b/StepMap/ContentView.swift index 4bd33d1..2792d75 100644 --- a/StepMap/ContentView.swift +++ b/StepMap/ContentView.swift @@ -5,15 +5,16 @@ // Created by Oliver Hnát on 23.11.2024. // -import SwiftUI import MapKit +import SwiftUI struct ContentView: View { - @ObservedObject var viewModel = ViewModel() - + @State private var position = MapCameraPosition.automatic @State private var showSearch: Bool = true + @State private var directions: [MKRoute] = [] + // TODO: create a map // Add navigation to the map // Display the calculated distance and how long will it take by walking @@ -23,21 +24,36 @@ struct ContentView: View { // show how long does the route take with said walking speed var body: some View { - Map(position: $position) -// .ignoresSafeArea() - .sheet(isPresented: $showSearch, content: { - SearchView() + Map(position: $position) { + ForEach(0..