Waypoint
public class Waypoint : Codableextension Waypoint: Equatableextension Waypoint: CustomStringConvertibleA Waypoint object indicates a location along a route. It may be the route’s origin or destination, or it may be another location that the route visits. A waypoint object indicates the location’s geographic location along with other optional information, such as a name or the user’s direction approaching the waypoint. You create a RouteOptions object using waypoint objects and also receive waypoint objects in the completion handler of the Directions.calculate(_:completionHandler:) method.
- 
                  
                  DeclarationSwift required public init(from decoder: Decoder) throws
- 
                  
                  DeclarationSwift public func encode(to encoder: Encoder) throws
- 
                  
                  Initializes a new waypoint object with the given geographic coordinate and an optional accuracy and name. It is recommended that the value of this argument be greater than the horizontalAccuracyproperty of aCLLocationobject obtained from aCLLocationManagerobject. There is a high likelihood that the user may be located some distance away from a navigable road, for instance if the user is currently on a driveway or inside a building.DeclarationSwift public init(coordinate: CLLocationCoordinate2D, coordinateAccuracy: CLLocationAccuracy? = nil, name: String? = nil)ParameterscoordinateThe geographic coordinate of the waypoint. coordinateAccuracyThe maximum distance away from the waypoint that the route may come and still be considered viable. This argument is measured in meters. A negative value means the route may be an indefinite number of meters away from the route and still be considered viable. nameThe name of the waypoint. This argument does not affect the route but may help you to distinguish one waypoint from another. 
- 
                  
                  Initializes a new waypoint object with the given CLLocationobject and an optional heading value and name.Note This initializer is intended for CLLocationobjects created using theCLLocation.init(latitude:longitude:)initializer. If you intend to use aCLLocationobject obtained from aCLLocationManagerobject, consider increasing thehorizontalAccuracyor set it to a negative value to avoid overfitting, since theWaypointclass’scoordinateAccuracyproperty represents the maximum allowed deviation from the waypoint. There is a high likelihood that the user may be located some distance away from a navigable road, for instance if the user is currently on a driveway of inside a building.
- 
                  
                  Initializes a new waypoint object with the given CLLocationobject and an optionalCLHeadingobject and name.Note This initializer is intended for CLLocationobjects created using theCLLocation.init(latitude:longitude:)initializer. If you intend to use aCLLocationobject obtained from aCLLocationManagerobject, consider increasing thehorizontalAccuracyor set it to a negative value to avoid overfitting, since theWaypointclass’scoordinateAccuracyproperty represents the maximum allowed deviation from the waypoint. There is a high likelihood that the user may be located some distance away from a navigable road, for instance if the user is currently on a driveway of inside a building.DeclarationSwift public init(location: CLLocation, heading: CLHeading? = nil, name: String? = nil)ParameterslocationA CLLocationobject representing the waypoint’s location. This initializer respects theCLLocationclass’scoordinateandhorizontalAccuracyproperties, converting them into thecoordinateandcoordinateAccuracyproperties, respectively.headingA CLHeadingobject representing the direction from which the route must approach the waypoint in order to be considered viable. This initializer respects theCLHeadingclass’strueHeadingproperty ormagneticHeadingproperty, converting it into theheadingAccuracyproperty.nameThe name of the waypoint. This argument does not affect the route but may help you to distinguish one waypoint from another. 
- 
                  
                  The geographic coordinate of the waypoint. DeclarationSwift public let coordinate: CLLocationCoordinate2D
- 
                  
                  The radius of uncertainty for the waypoint, measured in meters. For a route to be considered viable, it must enter this waypoint’s circle of uncertainty. The coordinateproperty identifies the center of the circle, while this property indicates the circle’s radius. If the value of this property is negative, a route is considered viable regardless of whether it enters this waypoint’s circle of uncertainty, subject to an undefined maximum distance.By default, the value of this property is nil.DeclarationSwift public var coordinateAccuracy: CLLocationAccuracy?
- 
                  
                  The geographic coordinate of the waypoint’s target. The waypoint’s target affects arrival instructions without affecting the route’s shape. For example, a delivery or ride hailing application may specify a waypoint target that represents a drop-off location. The target determines whether the arrival visual and spoken instructions indicate that the destination is “on the left” or “on the right”. By default, this property is set to nil, meaning the waypoint has no target. This property is ignored on the first waypoint of aRouteOptionsobject, on any waypoint of aMatchOptionsobject, or on any waypoint of aRouteOptionsobject ifDirectionsOptions.includesStepsis set tofalse.This property corresponds to the waypoint_targetsquery parameter in the Mapbox Directions and Map Matching APIs.DeclarationSwift public var targetCoordinate: CLLocationCoordinate2D?
- 
                  
                  The direction from which a route must approach this waypoint in order to be considered viable. This property is measured in degrees clockwise from true north. A value of 0 degrees means due north, 90 degrees means due east, 180 degrees means due south, and so on. If the value of this property is negative, a route is considered viable regardless of the direction from which it approaches this waypoint. If this waypoint is the first waypoint (the source waypoint), the route must start out by heading in the direction specified by this property. You should always set the headingAccuracyproperty in conjunction with this property. If theheadingAccuracyproperty is set tonil, this property is ignored.For driving directions, this property can be useful for avoiding a route that begins by going in the direction opposite the current direction of travel. For example, if you know the user is moving eastwardly and the first waypoint is the user’s current location, specifying a heading of 90 degrees and a heading accuracy of 90 degrees for the first waypoint avoids a route that begins with a “head west” instruction. You should be certain that the user is in motion before specifying a heading and heading accuracy; otherwise, you may be unnecessarily filtering out the best route. For example, suppose the user is sitting in a car parked in a driveway, facing due north, with the garage in front and the street to the rear. In that case, specifying a heading of 0 degrees and a heading accuracy of 90 degrees may result in a route that begins on the back alley or, worse, no route at all. For this reason, it is recommended that you only specify a heading and heading accuracy when automatically recalculating directions due to the user deviating from the route. By default, the value of this property is nil, meaning that a route is considered viable regardless of the direction of approach.DeclarationSwift public var heading: CLLocationDirection?
- 
                  
                  The maximum amount, in degrees, by which a route’s approach to a waypoint may differ from headingin either direction in order to be considered viable.A value of 0 degrees means that the approach must match the specified headingexactly – an unlikely scenario. A value of 180 degrees or more means that the approach may be as much as 180 degrees in either direction from the specifiedheading, effectively allowing a candidate route to approach the waypoint from any direction.If you set the headingproperty, you should set this property to a value such as 90 degrees, to avoid filtering out routes whose approaches differ only slightly from the specifiedheading. Otherwise, if theheadingproperty is set to a negative value, this property is ignored.By default, the value of this property is nil, meaning that a route is considered viable regardless of the direction of approach.DeclarationSwift public var headingAccuracy: CLLocationDirection?
- 
                  
                  A Boolean value indicating whether arriving on opposite side is allowed. This property has no effect if DirectionsOptions.includesStepsis set tofalse. This property corresponds to theapproachesquery parameter in the Mapbox Directions and Map Matching APIs.DeclarationSwift open var allowsArrivingOnOppositeSide: Bool
- 
                  
                  The name of the waypoint. This property does not affect the route, but the name is included in the arrival instruction, to help the user distinguish between multiple destinations. The name can also help you distinguish one waypoint from another in the array of waypoints passed into the completion handler of the Directions.calculate(_:completionHandler:)method.DeclarationSwift public var name: String?
- 
                  
                  A Boolean value indicating whether the waypoint is significant enough to appear in the resulting routes as a waypoint separating two legs, along with corresponding guidance instructions. By default, this property is set to true, which means that each resulting route will include a leg that ends by arriving at the waypoint asRouteLeg.destinationand a subsequent leg that begins by departing from the waypoint asRouteLeg.source. Otherwise, if this property is set tofalse, a single leg passes through the waypoint without specifically mentioning it. Regardless of the value of this property, each resulting route passes through the location specified by thecoordinateproperty, accounting for approach-related properties such asheading.With the Mapbox Directions API, set this property to falseif you want the waypoint’s location to influence the path that the route follows without attaching any meaning to the waypoint object itself. With the Mapbox Map Matching API, use this property when theDirectionsOptions.includesStepsproperty istrueor whencoordinatesrepresents a trace with a high sample rate. This property has no effect ifDirectionsOptions.includesStepsis set tofalse, or ifMatchOptions.waypointIndicesis non-nil. This property corresponds to theapproachesquery parameter in the Mapbox Directions and Map Matching APIs.DeclarationSwift public var separatesLegs: Bool
- 
                  
                  DeclarationSwift public static func == (lhs: Waypoint, rhs: Waypoint) -> Bool
- 
                  
                  DeclarationSwift public var description: String { get }
 Install in Dash
              Install in Dash
             Waypoint Class Reference
        Waypoint Class Reference