Skip to content

Commit 3989e5e

Browse files
committed
Add lastHeading property to StaticLocationManager.
1 parent 4dc3820 commit 3989e5e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/MapLibreSwiftUI/StaticLocationManager.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import MapLibre
88
/// doing some processing of raw location data (ex: determining whether to snap locations to a road) and selectively
99
/// passing the updates on to the map view.
1010
///
11-
/// You can provide a new location by setting the ``lastLocation`` property.
11+
/// You can provide updates by setting the ``lastLocation`` or ``lastHeading`` properties.
1212
///
1313
/// While this class is required to implement authorization status per the underlying protocol,
1414
/// it does not ever actually check whether you have access to Core Location services.
@@ -29,6 +29,13 @@ public final class StaticLocationManager: NSObject, @unchecked Sendable {
2929
delegate?.locationManager(self, didUpdate: [lastLocation])
3030
}
3131
}
32+
33+
public var lastHeading: CLHeading? {
34+
didSet {
35+
guard let heading = lastHeading else { return }
36+
delegate?.locationManager(self, didUpdate: heading)
37+
}
38+
}
3239

3340
public init(initialLocation: CLLocation) {
3441
lastLocation = initialLocation

0 commit comments

Comments
 (0)