GoogleNavigation Framework Reference

GMSNavigationWaypoint

@interface GMSNavigationWaypoint : NSObject <NSCopying, NSMutableCopying>

An immutable waypoint class, used to specify navigation destinations. It may be initialized from a CLLocationCoordinate2D or a Google Place ID.

  • Declaration

    Swift

    var title: String { get }

    Objective-C

    @property(nonatomic, readonly) NSString *title
  • The coordinates of the waypoint. This is kCLLocationCoordinate2DInvalid if this waypoint was initialized from a Place ID.

    Declaration

    Swift

    var coordinate: CLLocationCoordinate2D { get }

    Objective-C

    @property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
  • The Place ID of this waypoint. This is nil if this waypoint was initialized from coordinates.

    Declaration

    Swift

    var placeID: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *placeID;
  • Whether it is preferred to route the driver to the same side of the road. The route will arrive on the preferred side of the road unless there is a significant delay caused by a road closure or slow-moving traffic. Default to NO.

    Declaration

    Swift

    var preferSameSideOfRoad: Bool { get }

    Objective-C

    @property (nonatomic, readonly) BOOL preferSameSideOfRoad;
  • An angle used to express the direction of traffic on the side of the road that the vehicle should arrive on. Consequently, it is not useful for one-way streets. Units expressed in degrees [0, 360], where 0 means North and angles increase clockwise. Default and unset value is -1.

    Declaration

    Swift

    var preferredHeading: Int32 { get }

    Objective-C

    @property (nonatomic, readonly) int32_t preferredHeading;
  • Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pickup or drop-off. When you set this value, waypoints on roads that are unsuitable for pickup and drop-off may be adjusted to a more suitable location. This option works only for DRIVE and TWO_WHEELER travel modes. Default to NO. Note: In certain cases, particularly in metro areas, waypoints can not be set within tunnels even if vehicleStopover is set to NO.

    Declaration

    Swift

    var vehicleStopover: Bool { get }

    Objective-C

    @property (nonatomic, readonly) BOOL vehicleStopover;
  • Initializes this GMSNavigationWaypoint to represent a location specified by 2D coordinates.

    Declaration

    Swift

    init?(location: CLLocationCoordinate2D, title: String)

    Objective-C

    - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location
                                        title:(nonnull NSString *)title;

    Parameters

    location

    The location of this waypoint.

    title

    A string representing the name of the waypoint.

    Return Value

    An instance of GMSNavigationWaypoint, or nil if the location is not valid.

  • Initializes this GMSNavigationWaypoint to represent a location specified by a Place ID.

    Declaration

    Swift

    init?(placeID: String, title: String)

    Objective-C

    - (nullable instancetype)initWithPlaceID:(nonnull NSString *)placeID
                                       title:(nonnull NSString *)title;

    Parameters

    placeID

    The Google Place ID for this waypoint.

    title

    A string representing the name of the waypoint.

    Return Value

    An instance of GMSNavigationWaypoint, or nil if the Place ID string is nil or empty.

  • Initializes GMSNavigationWaypoint to represent a location specified by 2D coordinates and side of road preferences.

    Declaration

    Swift

    convenience init?(location: CLLocationCoordinate2D, title: String, preferSameSideOfRoad: Bool)

    Objective-C

    - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location
                                        title:(nonnull NSString *)title
                         preferSameSideOfRoad:(BOOL)preferSameSideOfRoad;

    Parameters

    location

    The latitude and longitude of the waypoint.

    title

    A string representing the name of the waypoint.

    preferSameSideOfRoad

    Whether it is preferred to route the driver to the same side of the road. The route will arrive on the preferred side of the road unless there is a significant delay caused by a road closure or slow-moving traffic.

    Return Value

    An instance of GMSNavigationWaypoint, or nil if the location is not valid.

  • Initializes GMSNavigationWaypoint to represent a location specified by 2D coordinates and side of road preferences.

    Declaration

    Swift

    convenience init?(location: CLLocationCoordinate2D, title: String, preferredSegmentHeading: Int32)

    Objective-C

    - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location
                                        title:(nonnull NSString *)title
                      preferredSegmentHeading:(int32_t)preferredSegmentHeading;

    Parameters

    location

    The latitude and longitude of the waypoint.

    title

    A string representing the name of the waypoint.

    preferredSegmentHeading

    An angle used to express the direction of traffic on the side of the road that the vehicle should arrive on. Consequently, it is not useful for one-way streets. Units expressed in degrees [0, 360], where 0 means North.

    Return Value

    An instance of GMSNavigationWaypoint, or nil if the location or the preferredSegmentHeading is not valid.

  • Unavailable

    Declaration

    Objective-C

    - (null_unspecified instancetype)init NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE;
  • Declaration

    Swift

    func copy() -> GMSNavigationWaypoint

    Objective-C

    - (GMSNavigationWaypoint *)copy;
  • Declaration

    Swift

    func mutableCopy() -> GMSNavigationMutableWaypoint

    Objective-C

    - (GMSNavigationMutableWaypoint *)mutableCopy;