File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
GoInfoGame/GoInfoGame/UI/Map Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ struct CustomMap: UIViewRepresentable {
5151 // Hide points of interest except street names
5252 mapView. pointOfInterestFilter = . excludingAll
5353 mapView. register ( CustomAnnotationView . self, forAnnotationViewWithReuseIdentifier: CustomAnnotationView . reuseIdentifier)
54-
55- let currentAltitude = mapView. camera. altitude
56-
54+
5755 if useBingMaps {
5856 let tileOverlay = BingTileOverlay ( )
5957 tileOverlay. minimumZ = 3 // Set minimum zoom level
@@ -184,13 +182,20 @@ struct CustomMap: UIViewRepresentable {
184182
185183 func mapViewDidFinishRenderingMap( _ mapView: MKMapView , fullyRendered: Bool ) {
186184 guard fullyRendered else { return }
187-
185+
186+ let userCoordinate = mapView. userLocation. coordinate
187+ guard CLLocationCoordinate2DIsValid ( userCoordinate) else { return }
188+
189+ let region = MKCoordinateRegion ( center: userCoordinate, latitudinalMeters: 1000 , longitudinalMeters: 1000 )
190+ let userLocationRect = MKMapRect ( region)
191+
188192 if shadowOverlay. visibleRects. isEmpty {
189- shadowOverlay. addVisibleRect ( mapView . visibleMapRect )
193+ shadowOverlay. addVisibleRect ( userLocationRect )
190194 mapView. removeOverlay ( shadowOverlay)
191195 mapView. addOverlay ( shadowOverlay)
192196 }
193197 }
198+
194199
195200 //renders polyline
196201 func mapView( _ mapView: MKMapView , rendererFor overlay: MKOverlay ) -> MKOverlayRenderer {
You can’t perform that action at this time.
0 commit comments