Skip to content

Commit 9324755

Browse files
authored
Use self.init instead of setting member variables directly. (#80)
- This way if the initializer should change, it will be a little more obvious for this client when re-building.
1 parent 13e4808 commit 9324755

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/MapLibreSwiftUI/MapView.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ public extension MapView where T == MLNMapViewController {
140140
locationManager: MLNLocationManager? = nil,
141141
@MapViewContentBuilder _ makeMapContent: () -> [StyleLayerDefinition] = { [] }
142142
) {
143-
makeViewController = {
144-
MLNMapViewController()
145-
}
146-
styleSource = .url(styleURL)
147-
_camera = camera
148-
userLayers = makeMapContent()
149-
self.locationManager = locationManager
143+
self.init(
144+
makeViewController: MLNMapViewController(),
145+
styleURL: styleURL,
146+
camera: camera,
147+
locationManager: locationManager,
148+
makeMapContent
149+
)
150150
}
151151
}
152152

0 commit comments

Comments
 (0)