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: add marker to map in location change view #362

Merged
merged 1 commit into from
Oct 26, 2024
Merged
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
12 changes: 7 additions & 5 deletions PennyMe/MachineChangedRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ struct MapView: View {
}

var body: some View {
let markers = [Marker(location: MapMarker(coordinate: centerCoordinate,
tint: .red))]
ZStack {
// add map
// Custom MapViewRepresentable for map type switching
MapViewRepresentable(mapType: $mapType, centerCoordinate: $centerCoordinate)
.edgesIgnoringSafeArea(.all)

// add finished button
// Overlay the marker at the center coordinate
Image(systemName: "mappin.circle.fill")
.foregroundColor(.red)
.font(.title)
.offset(y: -20) // Offset to position the marker correctly

VStack{
Spacer()
Button("Finished") {
Expand All @@ -102,7 +105,6 @@ struct MapView: View {
},
secondaryButton: .cancel(Text("Continue editing")) {
showDoneAlert = false

}
)
}
Expand Down
Loading