Skip to content

Commit

Permalink
run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Kladek committed Jun 11, 2024
1 parent 13a541a commit 013ef56
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Sources/MapLibreSwiftUI/MapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public struct MapView<T: WrappedViewController>: UIViewControllerRepresentable {

@Binding var camera: MapViewCamera

let makeViewController: (() -> T)?
let makeViewController: (() -> T)?
let styleSource: MapStyleSource
let userLayers: [StyleLayerDefinition]

Expand Down Expand Up @@ -37,31 +37,31 @@ public struct MapView<T: WrappedViewController>: UIViewControllerRepresentable {
var clusteredLayers: [ClusterLayer]?

public init(
makeViewController: @autoclosure @escaping () -> T,
makeViewController: @autoclosure @escaping () -> T,
styleURL: URL,
camera: Binding<MapViewCamera> = .constant(.default()),
locationManager: MLNLocationManager? = nil,
@MapViewContentBuilder _ makeMapContent: () -> [StyleLayerDefinition] = { [] }
) {
self.makeViewController = makeViewController
self.makeViewController = makeViewController
styleSource = .url(styleURL)
_camera = camera
userLayers = makeMapContent()
self.locationManager = locationManager
}

public init(
styleURL: URL,
camera: Binding<MapViewCamera> = .constant(.default()),
locationManager: MLNLocationManager? = nil,
@MapViewContentBuilder _ makeMapContent: () -> [StyleLayerDefinition] = { [] }
) {
makeViewController = nil
styleSource = .url(styleURL)
_camera = camera
userLayers = makeMapContent()
self.locationManager = locationManager
}

public init(
styleURL: URL,
camera: Binding<MapViewCamera> = .constant(.default()),
locationManager: MLNLocationManager? = nil,
@MapViewContentBuilder _ makeMapContent: () -> [StyleLayerDefinition] = { [] }
) {
self.makeViewController = nil
styleSource = .url(styleURL)
_camera = camera
userLayers = makeMapContent()
self.locationManager = locationManager
}

public func makeCoordinator() -> MapViewCoordinator<T> {
MapViewCoordinator<T>(
Expand All @@ -73,7 +73,7 @@ public struct MapView<T: WrappedViewController>: UIViewControllerRepresentable {

public func makeUIViewController(context: Context) -> T {
// Create the map view
let controller = self.makeViewController?() ?? T()
let controller = makeViewController?() ?? T()
controller.mapView.delegate = context.coordinator
context.coordinator.mapView = controller.mapView

Expand Down Expand Up @@ -145,7 +145,7 @@ public struct MapView<T: WrappedViewController>: UIViewControllerRepresentable {
}

#Preview {
MapView<MapViewController>(styleURL: demoTilesURL)
MapView<MapViewController>(styleURL: demoTilesURL)
.ignoresSafeArea(.all)
.previewDisplayName("Vanilla Map")

Expand Down

0 comments on commit 013ef56

Please sign in to comment.