File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
SwiftUI-WorkoutApp/Screens/SportsGrounds/Map Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,19 @@ struct MapViewUI: UIViewRepresentable {
3838 mapView. setRegion ( region, animated: true )
3939 mapView. showsUserLocation = true
4040 mapView. isRotateEnabled = false
41+ let trackingButton = MKUserTrackingButton ( mapView: mapView)
42+ trackingButton. translatesAutoresizingMaskIntoConstraints = false
43+ mapView. addSubview ( trackingButton)
44+ NSLayoutConstraint . activate ( [
45+ trackingButton. topAnchor. constraint (
46+ equalTo: mapView. layoutMarginsGuide. topAnchor,
47+ constant: 60
48+ ) ,
49+ trackingButton. trailingAnchor. constraint (
50+ equalTo: mapView. layoutMarginsGuide. trailingAnchor,
51+ constant: - 8
52+ )
53+ ] )
4154 mapView. cameraZoomRange = . init( maxCenterCoordinateDistance: 500000 )
4255 return mapView
4356 }
You can’t perform that action at this time.
0 commit comments