-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from OneBusAway/Issue-22-origin-destinaton_bas…
…ed_on_map Make Origin Destination Working Marker View
- Loading branch information
Showing
11 changed files
with
397 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// MapMarkingView.swift | ||
// OTPKit | ||
// | ||
// Created by Hilmy Veradin on 18/07/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct MapMarkingView: View { | ||
@ObservedObject private var locationManagerService = LocationManagerService.shared | ||
|
||
public init() {} | ||
public var body: some View { | ||
VStack { | ||
Spacer() | ||
|
||
Text("Tap on the map to add a pin.") | ||
.padding(16) | ||
.background(.regularMaterial) | ||
.cornerRadius(16) | ||
|
||
HStack(spacing: 16) { | ||
Button { | ||
locationManagerService.toggleMapMarkingMode(false) | ||
locationManagerService.selectCoordinate() | ||
} label: { | ||
Text("Cancel") | ||
.padding(8) | ||
.frame(maxWidth: .infinity) | ||
} | ||
.buttonStyle(.bordered) | ||
|
||
Button { | ||
locationManagerService.toggleMapMarkingMode(false) | ||
locationManagerService.selectCoordinate() | ||
} label: { | ||
Text("Add Pin") | ||
.padding(8) | ||
.frame(maxWidth: .infinity) | ||
} | ||
.buttonStyle(.borderedProminent) | ||
} | ||
.frame(maxWidth: .infinity) | ||
.padding(16) | ||
} | ||
.padding(.bottom, 24) | ||
} | ||
} | ||
|
||
#Preview { | ||
MapMarkingView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.