Skip to content

Commit

Permalink
Make FerrostarCore observable; use raw heading again
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Nov 11, 2023
1 parent dc33d3b commit 0c3fa25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apple/Sources/FerrostarCore/FerrostarCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public protocol FerrostarCoreDelegate: AnyObject {
/// The particulars will vary by app; do what makes the most sense for your user experience.
///
/// Finally, with a route selected, call ``startNavigation(route:)`` to start a session.
@objc public class FerrostarCore: NSObject {
@objc public class FerrostarCore: NSObject, ObservableObject {
/// The delegate which will receive Ferrostar core events.
public weak var delegate: FerrostarCoreDelegate?

/// The observable state of the model (for easy binding in SwiftUI views).
public private(set) var observableState: FerrostarObservableState?
@Published public private(set) var observableState: FerrostarObservableState?

private let networkSession: URLRequestLoading
private let routeAdapter: UniFFI.RouteAdapterProtocol
Expand Down
2 changes: 1 addition & 1 deletion apple/Sources/FerrostarMapLibreUI/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public struct NavigationMapView: View {

SymbolStyleLayer(identifier: "user-location", source: userLocationSource)
.iconImage(constant: UIImage(systemName: "location.north.circle.fill")!)
.iconRotation(constant: navigationState.courseOverGround?.magnitude ?? 0)
.iconRotation(constant: navigationState.heading?.trueHeading.magnitude ?? 0)
}
.edgesIgnoringSafeArea(.all)
.overlay(alignment: .top, content: {
Expand Down

0 comments on commit 0c3fa25

Please sign in to comment.