diff --git a/apple/DemoApp/Demo/DemoNavigationView.swift b/apple/DemoApp/Demo/DemoNavigationView.swift index 3fd89aba..6d6de401 100644 --- a/apple/DemoApp/Demo/DemoNavigationView.swift +++ b/apple/DemoApp/Demo/DemoNavigationView.swift @@ -32,6 +32,7 @@ struct DemoNavigationView: View { } @State private var camera: MapViewCamera = .center(initialLocation.coordinate, zoom: 14) + @State private var snappedCamera = true init() { let simulated = SimulatedLocationProvider(location: initialLocation) @@ -67,7 +68,7 @@ struct DemoNavigationView: View { navigationState: ferrostarCore.state, camera: $camera, snappedZoom: .constant(18), - useSnappedCamera: .constant(true) + useSnappedCamera: $snappedCamera ) { let source = ShapeSource(identifier: "userLocation") { // Demonstrate how to add a dynamic overlay; diff --git a/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapView.swift b/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapView.swift index 5aa430d5..902b0bb1 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapView.swift @@ -108,8 +108,8 @@ public struct NavigationMapView: View { .gesture( DragGesture() .onChanged { gesture in - guard gesture.velocity.width > breakwayVelocity - || gesture.velocity.height > breakwayVelocity + guard abs(gesture.velocity.width) > breakwayVelocity + || abs(gesture.velocity.height) > breakwayVelocity else { return }