Skip to content

Commit 4ba449d

Browse files
author
Achyut Kumar M
committed
add shadowOverlay to CustomMap
1 parent 08efe0a commit 4ba449d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

GoInfoGame/GoInfoGame/UI/Map/CustomMap.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ struct CustomMap: UIViewRepresentable {
8484

8585
// Remove existing overlays
8686
mapView.overlays.forEach { mapView.removeOverlay($0) }
87-
87+
88+
// Add shadow overlay with rectangular cutouts
89+
if mapView.overlays.first(where: { $0 is ShadowOverlay }) == nil {
90+
let overlay = ShadowOverlay(annotations: mapView.annotations)
91+
mapView.addOverlay(overlay)
92+
}
93+
94+
8895
// Re-add overlays based on selection
8996
if useBingMaps {
9097
let tileOverlay = BingTileOverlay()
@@ -183,6 +190,10 @@ struct CustomMap: UIViewRepresentable {
183190
return renderer
184191
}
185192

193+
if let shadowOverlay = overlay as? ShadowOverlay {
194+
return ShadowOverlayRenderer(overlay: shadowOverlay)
195+
}
196+
186197
if let tileOverlay = overlay as? MKTileOverlay {
187198
return MKTileOverlayRenderer(tileOverlay: tileOverlay)
188199
}

0 commit comments

Comments
 (0)