Search code examples
swiftswiftuimkmapviewnavigationviewswiftui-navigationlink

Mapview shows White overlay on Interaction


I am using GMSMapView with SwiftUI, in map-view I have to display some markers with lat and long. Upon clicking any marker I have to Move to another view. I am doing this by putting MapView in NavigationLink. This thing is working fine By using code.

NavigationView {
    NavigationLink(destination: Text(""), isActive: $abc) {
        MapView().edgesIgnoringSafeArea(.all)
    }
}

And the issue is NavigationLink, after putting mapview in NavigationLink every-time when i interact with map, white overlay blinks. White overlay shows over complete map and Images are attached with and without overlay.

Screenshot without overlay

Screenshot with overlay


Solution

  • Use instead

    NavigationView {
        MapView().edgesIgnoringSafeArea(.all)
        .background(NavigationLink(destination: Text(""), 
            isActive: $abc) { EmptyView() })
    }