diff --git a/Sources/MapLibreSwiftUI/MapView.swift b/Sources/MapLibreSwiftUI/MapView.swift index 5f24829..a8ffc03 100644 --- a/Sources/MapLibreSwiftUI/MapView.swift +++ b/Sources/MapLibreSwiftUI/MapView.swift @@ -140,13 +140,13 @@ public extension MapView where T == MLNMapViewController { locationManager: MLNLocationManager? = nil, @MapViewContentBuilder _ makeMapContent: () -> [StyleLayerDefinition] = { [] } ) { - makeViewController = { - MLNMapViewController() - } - styleSource = .url(styleURL) - _camera = camera - userLayers = makeMapContent() - self.locationManager = locationManager + self.init( + makeViewController: MLNMapViewController(), + styleURL: styleURL, + camera: camera, + locationManager: locationManager, + makeMapContent + ) } }