-
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 #6 from ricobeck/master
[WIP] Adds support for waypoints
- Loading branch information
Showing
5 changed files
with
148 additions
and
2 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
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,32 @@ | ||
import Foundation | ||
|
||
/// Value type describing a single Waypoint defined within a `GPXTrack`. A `Waypoint` has a location consisting of latitude, longitude and some metadata, | ||
/// e.g. name and description. | ||
public struct Waypoint: Hashable { | ||
/// The coordinate (latitude, longitude and elevation in meters) | ||
public var coordinate: Coordinate | ||
/// Optional date for a given point. | ||
public var date: Date? | ||
/// Optional name of the waypoint | ||
public var name: String? | ||
/// Optional comment for the waypoint | ||
public var comment: String? | ||
/// Optional description of the waypoint | ||
public var description: String? | ||
|
||
/// Initializer | ||
/// You don't need to construct this value by yourself, as it is done by GXPKits track parsing logic. | ||
/// - Parameters: | ||
/// - coordinate: Location of the waypoint, required | ||
/// - date: Optional date | ||
/// - name: Name of the waypoint | ||
/// - comment: A short comment | ||
/// - description: A longer description | ||
public init(coordinate: Coordinate, date: Date? = nil, name: String? = nil, comment: String? = nil, description: String? = nil) { | ||
self.coordinate = coordinate | ||
self.date = date | ||
self.name = name | ||
self.comment = comment | ||
self.description = description | ||
} | ||
} |
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