Has anyone encountered a problem with removing polylines from MApKit in SwiftUI ? I’m using
uiView.removeAnnotations(uiView.annotations
uiView.removeOverlays(uiView.overlays)
But the annotations get removed the circles that I have also added get removed but not the polylines !
I’m adding the Polylines the following way
annotation.coordinate = CLLocationCoordinate2D(latitude: locations.lat, longitude: locations.lon)
let con = locations_map.count
let polyline = MKGeodesicPolyline(coordinates: locations_map, count: con )
//print(contagem)
let circle = MKCircle(center: destination, radius: locations.accuracy)
uiView.setRegion(mapRegion, animated: true)
uiView.delegate = context.coordinator
uiView.addOverlay(polyline)
uiView.addAnnotation(annotation)
uiView.addOverlay(circle)
Does anyone have an ideia why ?
Thank you