I am trying to implement route planning via Google Maps and Waze, but my map keeps showing a button that takes me to the Maps app and allows me to plan the route there.
I couldn’t find anything on Google and none of the video tutorials have this button.
iOS 18.1
Here is my code:
var body: some View {
Map(coordinateRegion: .constant(region))
.frame(height: UIScreen.main.bounds.width * 0.7)
.frame(maxWidth: .infinity)
}
I also tried adding a button above this button, but for some reason it still ended up below it.
var body: some View {
ZStack(alignment: .bottomTrailing) {
Map(coordinateRegion: .constant(region))
.frame(height: UIScreen.main.bounds.width * 0.7)
.frame(maxWidth: .infinity)
Button {
print("Tapped")
} label: {
Image(systemName: "car.fill")
.padding()
.background(.white)
.tint(.secondary)
.clipShape(Circle())
.shadow(color: .black.opacity(0.7), radius: 6, x: 0, y: 2)
}
}
}
Is there any way to implement this feature?