GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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.
-
Declaration
Objective-C
- (null_unspecified instancetype)init NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE;
-
Declaration
Swift
func copy() -> GMSNavigationWaypoint
Objective-C
- (GMSNavigationWaypoint *)copy;
-
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSNavigationWaypoint\u003c/code\u003e is an immutable class used to define destinations for navigation, initialized using coordinates or a Google Place ID.\u003c/p\u003e\n"],["\u003cp\u003eWaypoints can have a title, coordinates, Place ID, and preferences for side of road and heading.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for initialization using location, Place ID, and side of road preferences.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSNavigationWaypoint\u003c/code\u003e offers properties to access the title, coordinates, Place ID, and road preferences of the waypoint.\u003c/p\u003e\n"],["\u003cp\u003eWhile immutable itself, it can be copied or mutated into a \u003ccode\u003eGMSNavigationMutableWaypoint\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# GoogleNavigation Framework Reference\n\nGMSNavigationWaypoint\n=====================\n\n @interface GMSNavigationWaypoint : NSObject \u003cNSCopying, NSMutableCopying\u003e\n\nAn immutable waypoint class, used to specify navigation destinations. It may be initialized from\na `CLLocationCoordinate2D` or a Google Place ID.\n- `\n ``\n ``\n `\n\n ### [title](#/c:objc(cs)GMSNavigationWaypoint(py)title)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var title: String { get }\n\n Objective-C \n\n @property(nonatomic, readonly) NSString *title\n\n- `\n ``\n ``\n `\n\n ### [coordinate](#/c:objc(cs)GMSNavigationWaypoint(py)coordinate)\n\n `\n ` \n The coordinates of the waypoint. This is `kCLLocationCoordinate2DInvalid` if this waypoint was\n initialized from a Place ID. \n\n #### Declaration\n\n Swift \n\n var coordinate: CLLocationCoordinate2D { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CLLocationCoordinate2D coordinate;\n\n- `\n ``\n ``\n `\n\n ### [placeID](#/c:objc(cs)GMSNavigationWaypoint(py)placeID)\n\n `\n ` \n The Place ID of this waypoint. This is nil if this waypoint was initialized from coordinates. \n\n #### Declaration\n\n Swift \n\n var placeID: String? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) NSString *placeID;\n\n- `\n ``\n ``\n `\n\n ### [preferSameSideOfRoad](#/c:objc(cs)GMSNavigationWaypoint(py)preferSameSideOfRoad)\n\n `\n ` \n Whether it is preferred to route the driver to the same side of the\n road. The route will arrive on the preferred side of the road unless there is a significant\n delay caused by a road closure or slow-moving traffic. Default to NO. \n\n #### Declaration\n\n Swift \n\n var preferSameSideOfRoad: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL preferSameSideOfRoad;\n\n- `\n ``\n ``\n `\n\n ### [preferredHeading](#/c:objc(cs)GMSNavigationWaypoint(py)preferredHeading)\n\n `\n ` \n An angle used to express the direction of traffic on the side of the road that the vehicle\n should arrive on. Consequently, it is not useful for one-way streets.\n Units expressed in degrees \\[0, 360\\], where 0 means North and angles increase clockwise.\n Default and unset value is -1. \n\n #### Declaration\n\n Swift \n\n var preferredHeading: Int32 { get }\n\n Objective-C \n\n @property (nonatomic, readonly) int32_t preferredHeading;\n\n- `\n ``\n ``\n `\n\n ### [vehicleStopover](#/c:objc(cs)GMSNavigationWaypoint(py)vehicleStopover)\n\n `\n ` \n Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either\n pickup or drop-off. When you set this value, waypoints on roads that are unsuitable for pickup\n and drop-off may be adjusted to a more suitable location. This option works only for DRIVE and\n TWO_WHEELER travel modes. Default to NO. Note: In certain cases, particularly in metro areas,\n waypoints can not be set within tunnels even if vehicleStopover is set to NO. \n\n #### Declaration\n\n Swift \n\n var vehicleStopover: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL vehicleStopover;\n\n- `\n ``\n ``\n `\n\n ### [-initWithLocation:title:](#/c:objc(cs)GMSNavigationWaypoint(im)initWithLocation:title:)\n\n `\n ` \n Initializes this `GMSNavigationWaypoint` to represent a location specified by 2D coordinates. \n\n #### Declaration\n\n Swift \n\n init?(location: CLLocationCoordinate2D, title: String)\n\n Objective-C \n\n - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location\n title:(nonnull NSString *)title;\n\n #### Parameters\n\n |------------------|-------------------------------------------------|\n | ` `*location*` ` | The location of this waypoint. |\n | ` `*title*` ` | A string representing the name of the waypoint. |\n\n #### Return Value\n\n An instance of `GMSNavigationWaypoint,` or nil if the location is not valid.\n- `\n ``\n ``\n `\n\n ### [-initWithPlaceID:title:](#/c:objc(cs)GMSNavigationWaypoint(im)initWithPlaceID:title:)\n\n `\n ` \n Initializes this `GMSNavigationWaypoint` to represent a location specified by a Place ID. \n\n #### Declaration\n\n Swift \n\n init?(placeID: String, title: String)\n\n Objective-C \n\n - (nullable instancetype)initWithPlaceID:(nonnull NSString *)placeID\n title:(nonnull NSString *)title;\n\n #### Parameters\n\n |-----------------|-------------------------------------------------|\n | ` `*placeID*` ` | The Google Place ID for this waypoint. |\n | ` `*title*` ` | A string representing the name of the waypoint. |\n\n #### Return Value\n\n An instance of `GMSNavigationWaypoint,` or nil if the Place ID string is nil or empty.\n- `\n ``\n ``\n `\n\n ### [-initWithLocation:title:preferSameSideOfRoad:](#/c:objc(cs)GMSNavigationWaypoint(im)initWithLocation:title:preferSameSideOfRoad:)\n\n `\n ` \n Initializes `GMSNavigationWaypoint` to represent a location specified by 2D coordinates and side\n of road preferences. \n\n #### Declaration\n\n Swift \n\n convenience init?(location: CLLocationCoordinate2D, title: String, preferSameSideOfRoad: Bool)\n\n Objective-C \n\n - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location\n title:(nonnull NSString *)title\n preferSameSideOfRoad:(BOOL)preferSameSideOfRoad;\n\n #### Parameters\n\n |------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*location*` ` | The latitude and longitude of the waypoint. |\n | ` `*title*` ` | A string representing the name of the waypoint. |\n | ` `*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. |\n\n #### Return Value\n\n An instance of `GMSNavigationWaypoint,` or nil if the location is not valid.\n- `\n ``\n ``\n `\n\n ### [-initWithLocation:title:preferredSegmentHeading:](#/c:objc(cs)GMSNavigationWaypoint(im)initWithLocation:title:preferredSegmentHeading:)\n\n `\n ` \n Initializes `GMSNavigationWaypoint` to represent a location specified by 2D coordinates and side\n of road preferences. \n\n #### Declaration\n\n Swift \n\n convenience init?(location: CLLocationCoordinate2D, title: String, preferredSegmentHeading: Int32)\n\n Objective-C \n\n - (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location\n title:(nonnull NSString *)title\n preferredSegmentHeading:(int32_t)preferredSegmentHeading;\n\n #### Parameters\n\n |---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*location*` ` | The latitude and longitude of the waypoint. |\n | ` `*title*` ` | A string representing the name of the waypoint. |\n | ` `*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. |\n\n #### Return Value\n\n An instance of `GMSNavigationWaypoint,` or nil if the location or the\n preferredSegmentHeading is not valid.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMSNavigationWaypoint(im)init)\n\n `\n ` \n Unavailable \n\n #### Declaration\n\n Objective-C \n\n - (null_unspecified instancetype)init NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE;\n\n- `\n ``\n ``\n `\n\n ### [-copy](#/c:objc(cs)GMSNavigationWaypoint(im)copy)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func copy() -\u003e GMSNavigationWaypoint\n\n Objective-C \n\n - (GMSNavigationWaypoint *)copy;\n\n- `\n ``\n ``\n `\n\n ### [-mutableCopy](#/c:objc(cs)GMSNavigationWaypoint(im)mutableCopy)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func mutableCopy() -\u003e ../Classes/GMSNavigationMutableWaypoint.html\n\n Objective-C \n\n - (../Classes/GMSNavigationMutableWaypoint.html *)mutableCopy;"]]