diff --git a/Sources/MapLibreSwiftUI/StaticLocationManager.swift b/Sources/MapLibreSwiftUI/StaticLocationManager.swift index b94ba51..5d68732 100644 --- a/Sources/MapLibreSwiftUI/StaticLocationManager.swift +++ b/Sources/MapLibreSwiftUI/StaticLocationManager.swift @@ -8,7 +8,7 @@ import MapLibre /// doing some processing of raw location data (ex: determining whether to snap locations to a road) and selectively /// passing the updates on to the map view. /// -/// You can provide a new location by setting the ``lastLocation`` property. +/// You can provide updates by setting the ``lastLocation`` or ``lastHeading`` properties. /// /// While this class is required to implement authorization status per the underlying protocol, /// 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 { } } + public var lastHeading: CLHeading? { + didSet { + guard let lastHeading else { return } + delegate?.locationManager(self, didUpdate: lastHeading) + } + } + public init(initialLocation: CLLocation) { lastLocation = initialLocation }