Skip to content

Commit

Permalink
Fix: add marker to map in location change view (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaWie authored Oct 26, 2024
1 parent 787fa3f commit f263042
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit f263042

Please sign in to comment.