Skip to content
Open
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
20 changes: 19 additions & 1 deletion apple/Sources/FerrostarMapLibreUI/Views/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,25 @@ public struct NavigationMapView: View {
}

private func calculatedMapViewInsets(for geometry: GeometryProxy) -> NavigationMapViewContentInsetMode {
contentInsetConfig.bundle.dynamicWithCameraState(camera.state, isLandscape: geometry.isLandscape)(geometry)
if navigationState?.isNavigating == true {
return contentInsetConfig.bundle.dynamicWithCameraState(camera.state, isLandscape: geometry.isLandscape)(geometry)
}

switch camera.state {
case .rect, .showcase:
if geometry.isLandscape {
return contentInsetConfig.getShowcaseLandscapeInset(for: geometry)
} else {
return contentInsetConfig.getShowcasePortraitInset(for: geometry)
}
default:
return .edgeInset(UIEdgeInsets(
top: geometry.safeAreaInsets.top,
left: geometry.safeAreaInsets.leading,
bottom: geometry.safeAreaInsets.bottom,
right: geometry.safeAreaInsets.trailing
))
}
}

private func updateCameraIfNeeded() {
Expand Down