Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Sources/MapLibreSwiftUI/StaticLocationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Loading