Skip to content

Commit

Permalink
Merge pull request #111 from Max-Leopold/max-leopold/fix-breaking-out…
Browse files Browse the repository at this point in the history
…-from-navigation-camera

Fix breaking out from navigation camera on iOS
  • Loading branch information
ianthetechie authored Jun 4, 2024
2 parents 5efca24 + 49365fc commit bd5272e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apple/DemoApp/Demo/DemoNavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bd5272e

Please sign in to comment.