HomeiOS DevelopmentFind out how to take away "Construct route" button from MapKit Map...

Find out how to take away "Construct route" button from MapKit Map in SwiftUI


I’m attempting to implement route planning through Google Maps and Waze, however my map retains displaying a button that takes me to the Maps app and permits me to plan the route there.
I could not discover something on Google and not one of the video tutorials have this button.

iOS 18.1

Right here is my code:

    var physique: some View {
    Map(coordinateRegion: .fixed(area))
        .body(peak: UIScreen.primary.bounds.width * 0.7)
        .body(maxWidth: .infinity)
}

Find out how to take away "Construct route" button from MapKit Map in SwiftUI

I additionally tried including a button above this button, however for some purpose it nonetheless ended up beneath it.

enter image description here

 var physique: some View {
    ZStack(alignment: .bottomTrailing) {
        Map(coordinateRegion: .fixed(area))
            .body(peak: UIScreen.primary.bounds.width * 0.7)
            .body(maxWidth: .infinity)
        Button {
            print("Tapped")
        } label: {
            Picture(systemName: "automotive.fill")
                .padding()
                .background(.white)
                .tint(.secondary)
                .clipShape(Circle())
                .shadow(coloration: .black.opacity(0.7), radius: 6, x: 0, y: 2)
        }
    }
}

Is there any technique to implement this characteristic?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments