From e845e5024d1196ce64b00fbed1fc06cc6f9f3e4c Mon Sep 17 00:00:00 2001 From: Wayne Bishop Date: Mon, 16 Dec 2024 13:49:59 -0800 Subject: [PATCH] fix: reset markers at updateUIView --- .../GoogleMaps-SwiftUI/GoogleMapView/GoogleMapView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/GoogleMapView/GoogleMapView.swift b/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/GoogleMapView/GoogleMapView.swift index 22fde2a1..cefb610c 100644 --- a/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/GoogleMapView/GoogleMapView.swift +++ b/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/GoogleMapView/GoogleMapView.swift @@ -65,6 +65,9 @@ struct GoogleMapView: UIViewRepresentable { uiView.backgroundColor = backgroundColor } + //clears all markers and polylines + uiView.clear() + // Refresh markers on the map markers.forEach { marker in marker.map = uiView