File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public struct MapView<T: MapViewHostViewController>: UIViewControllerRepresentab
18
18
var onStyleLoaded : ( ( MLNStyle ) -> Void ) ?
19
19
var onViewPortChanged : ( ( MapViewPort ) -> Void ) ?
20
20
21
- public var mapViewContentInset : UIEdgeInsets = . zero
21
+ var mapViewContentInset : UIEdgeInsets ? = . zero
22
22
23
23
var unsafeMapViewControllerModifier : ( ( T ) -> Void ) ?
24
24
@@ -103,13 +103,16 @@ public struct MapView<T: MapViewHostViewController>: UIViewControllerRepresentab
103
103
104
104
if cameraDisabled == false {
105
105
context. coordinator. updateCamera ( mapView: uiViewController. mapView,
106
- camera: $ camera. wrappedValue ,
106
+ camera: camera,
107
107
animated: isStyleLoaded)
108
108
}
109
109
}
110
110
111
111
@MainActor private func applyModifiers( _ mapViewController: T , runUnsafe: Bool ) {
112
- mapViewController. mapView. contentInset = mapViewContentInset
112
+ if let mapViewContentInset {
113
+ mapViewController. mapView. automaticallyAdjustsContentInset = false
114
+ mapViewController. mapView. contentInset = mapViewContentInset
115
+ }
113
116
114
117
// Assume all controls are hidden by default (so that an empty list returns a map with no controls)
115
118
mapViewController. mapView. logoView. isHidden = true
You can’t perform that action at this time.
0 commit comments