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(iOS): Make map padding uniform #717

Merged
merged 4 commits into from
Feb 7, 2025
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
8 changes: 6 additions & 2 deletions iosApp/iosApp/Pages/Map/AnnotatedMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

var handleCameraChange: (CameraChanged) -> Void
var handleStyleLoaded: () -> Void
var handleTapStopLayer: (QueriedFeature, MapContentGestureContext) -> Bool

Check notice on line 35 in iosApp/iosApp/Pages/Map/AnnotatedMap.swift

View check run for this annotation

Xcode Cloud / MBTA Transit Staging | PR Branch Workflow | iosAppRetries - iOS

iosApp/iosApp/Pages/Map/AnnotatedMap.swift#L35

'MapContentGestureContext' is deprecated: renamed to 'InteractionContext'
var handleTapVehicle: (Vehicle) -> Void

@State private var zoomLevel: CGFloat = 0
Expand All @@ -48,7 +48,10 @@
.debugOptions(devDebugMode ? .camera : [])
.cameraBounds(.init(maxZoom: 18, minZoom: 6))
.onCameraChanged { change in handleCameraChange(change) }
.ornamentOptions(.init(scaleBar: .init(visibility: .hidden)))
.ornamentOptions(.init(
scaleBar: .init(visibility: .hidden),
attributionButton: .init(margins: .init(x: 0, y: 8))
))
.onLayerTapGesture(StopLayerGenerator.shared.stopLayerId, perform: handleTapStopLayer)
.onLayerTapGesture(StopLayerGenerator.shared.stopTouchTargetLayerId, perform: handleTapStopLayer)
.onStyleLoaded { _ in
Expand All @@ -61,7 +64,8 @@
handleStyleLoaded()
}
}
.additionalSafeAreaInsets(.bottom, sheetHeight)
.additionalSafeAreaInsets(.bottom, sheetHeight + 8)
.additionalSafeAreaInsets(.top, 20)
.accessibilityIdentifier("transitMap")
.onReceive(viewportProvider.cameraStatePublisher) { newCameraState in
zoomLevel = newCameraState.zoom
Expand Down
4 changes: 2 additions & 2 deletions iosApp/iosApp/Pages/Map/HomeMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ struct HomeMapView: View {

private var crosshairs: some View {
VStack {
Image("map-nearby-location-cursor")
Image(.mapNearbyLocationCursor)
Spacer()
.frame(height: sheetHeight)
.frame(height: sheetHeight - 12)
}
}

Expand Down