-
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #31 from OneBusAway/Issue-22-origin-destinaton_bas…
…ed_on_map Issue 22 - Origin Destinatoin Map Marker
- Loading branch information
Showing
25 changed files
with
90 additions
and
42 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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,14 @@ | ||
// | ||
// MarkerItem.swift | ||
// OTPKit | ||
// | ||
// Created by Hilmy Veradin on 16/07/24. | ||
// | ||
|
||
import Foundation | ||
import MapKit | ||
|
||
public struct MarkerItem: Identifiable, Hashable { | ||
public let id: UUID = .init() | ||
public let item: MKMapItem | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// MapExtensionServices.swift | ||
// OTPKit | ||
// | ||
// Created by Hilmy Veradin on 16/07/24. | ||
// | ||
|
||
import Foundation | ||
import MapKit | ||
import SwiftUI | ||
|
||
/// Manage Map extension such as markers, etc | ||
public final class MapExtensionServices: ObservableObject { | ||
public static let shared = MapExtensionServices() | ||
|
||
@Published public var selectedMapPoint: [MarkerItem] = [] | ||
|
||
public func appendMarker(coordinate: CLLocationCoordinate2D) { | ||
let mapItem = MKMapItem(placemark: .init(coordinate: coordinate)) | ||
let markerItem = MarkerItem(item: mapItem) | ||
selectedMapPoint.append(markerItem) | ||
} | ||
|
||
/// Generate MapKit Marker View | ||
public func generateMarkers() -> ForEach<[MarkerItem], MarkerItem.ID, Marker<Text>> { | ||
ForEach(selectedMapPoint, id: \.id) { markerItem in | ||
Marker(item: markerItem.item) | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ settings: | |
|
||
options: | ||
deploymentTarget: | ||
iOS: "16.0" | ||
iOS: "17.0" | ||
|
||
targets: | ||
OTPKitDemo: | ||
|
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