Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix breaking out from navigation camera on iOS #111

Merged
Show file tree
Hide file tree
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
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
Loading