Skip to content

Commit 879bd06

Browse files
committed
PR fixes
1 parent 1c321e6 commit 879bd06

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

Sources/MapLibreSwiftUI/Extensions/MapLibre/MLNMapViewCameraUpdating.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Foundation
33
import MapLibre
44
import Mockable
55

6+
// NOTE: We should eventually mark the entire protocol @MainActor, but Mockable generates some unsafe code at the moment
67
@Mockable
78
protocol MLNMapViewCameraUpdating: AnyObject {
89
@MainActor var userTrackingMode: MLNUserTrackingMode { get set }

Sources/MapLibreSwiftUI/MapViewCoordinator.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public class MapViewCoordinator: NSObject {
5454
}
5555

5656
suppressCameraUpdatePropagation = true
57+
defer {
58+
suppressCameraUpdatePropagation = false
59+
}
60+
5761
switch camera.state {
5862
case let .centered(onCoordinate: coordinate, zoom: zoom, pitch: pitch, direction: direction):
5963
mapView.userTrackingMode = .none
@@ -92,7 +96,6 @@ public class MapViewCoordinator: NSObject {
9296
}
9397

9498
snapshotCamera = camera
95-
suppressCameraUpdatePropagation = false
9699
}
97100

98101
// MARK: - Coordinator API - Styles + Layers
@@ -247,7 +250,7 @@ extension MapViewCoordinator: MLNMapViewDelegate {
247250
return
248251
}
249252

250-
// FIXME: CI complains about this being unavailable before iOS 17, despite building on iOS 17.2... This is an epic hack to fix it for now. I can only assume this is an issue with Xcode pre-15.3
253+
// FIXME: CI complains about MainActor.assumeIsolated being unavailable before iOS 17, despite building on iOS 17.2... This is an epic hack to fix it for now. I can only assume this is an issue with Xcode pre-15.3
251254
Task { @MainActor in
252255
updateParentCamera(mapView: mapView, reason: reason)
253256
}

Sources/MapLibreSwiftUI/StaticLocationManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public final class StaticLocationManager: NSObject, @unchecked Sendable {
2020
}
2121
}
2222

23+
// TODO: Investigate what this does and document it
2324
public var headingOrientation: CLDeviceOrientation = .portrait
2425

2526
public var lastLocation: CLLocation {

Tests/MapLibreSwiftUITests/Examples/MapControlsTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ final class MapControlsTests: XCTestCase {
2222
}
2323
}
2424

25+
func testLogoChangePosition() {
26+
assertView {
27+
MapView(styleURL: demoTilesURL)
28+
.mapControls {
29+
LogoView()
30+
.position(.topLeft)
31+
}
32+
}
33+
}
34+
2535
func testCompassOnly() {
2636
assertView {
2737
MapView(styleURL: demoTilesURL)
80.5 KB
Loading

0 commit comments

Comments
 (0)