Skip to content

Commit 8cdec1b

Browse files
committed
Add lastHeading property to StaticLocationManager.
1 parent 98aa8cd commit 8cdec1b

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.
@@ -30,6 +30,13 @@ public final class StaticLocationManager: NSObject, @unchecked Sendable {
3030
}
3131
}
3232

33+
public var lastHeading: CLHeading? {
34+
didSet {
35+
guard let heading = lastHeading else { return }
36+
delegate?.locationManager(self, didUpdate: heading)
37+
}
38+
}
39+
3340
public init(initialLocation: CLLocation) {
3441
lastLocation = initialLocation
3542
}

0 commit comments

Comments
 (0)