From 77b05eca8364d9ac9ca1cd0f89e60d1d347a2e94 Mon Sep 17 00:00:00 2001 From: Greg Bolsinga Date: Thu, 24 Apr 2025 10:29:10 -0700 Subject: [PATCH] Use self.init instead of setting member variables directly. - This way if the initializer should change, it will be a little more obvious for this client when re-building. --- Sources/MapLibreSwiftUI/MapView.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 + ) } }