GMSNavigationWaypoint Class Reference

GMSNavigationWaypoint Class Reference

Overview

An immutable waypoint class, used to specify navigation destinations.

It may be initialized from a CLLocationCoordinate2D or a Google Place ID.

Inherited by GMSNavigationMutableWaypoint.

Public Member Functions

(nullable instancetype) - initWithLocation:title:
 Initializes this GMSNavigationWaypoint to represent a location specified by 2D coordinates.
(nullable instancetype) - initWithPlaceID:title:
 Initializes this GMSNavigationWaypoint to represent a location specified by a Place ID.
(nullable instancetype) - initWithLocation:title:preferSameSideOfRoad:
 Initializes GMSNavigationWaypoint to represent a location specified by 2D coordinates and side of road preferences.
(nullable instancetype) - initWithLocation:title:preferredSegmentHeading:
 Initializes GMSNavigationWaypoint to represent a location specified by 2D coordinates and side of road preferences.
(GMSNavigationWaypoint *) - copy
 Returns a copy of this waypoint.
(GMSNavigationMutableWaypoint *) - mutableCopy
 Returns a mutable copy of this waypoint.

Properties

NSString * title
 The name of the waypoint.
CLLocationCoordinate2D coordinate
 The coordinates of the waypoint.
NSString * placeID
 The Place ID of this waypoint.
BOOL preferSameSideOfRoad
 Whether it is preferred to route the driver to the same side of the road.
int32_t preferredHeading
 An angle used to express the direction of traffic on the side of the road that the vehicle should arrive on.
BOOL vehicleStopover
 Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pickup or drop-off.

Member Function Documentation

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

Initializes this GMSNavigationWaypoint to represent a location specified by 2D coordinates.

Parameters:
locationThe location of this waypoint.
titleA string representing the name of the waypoint.
Returns:
An instance of GMSNavigationWaypoint, or nil if the location is not valid.
- (nullable instancetype) initWithPlaceID: (NSString *)  placeID
title: (NSString *)  title 

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

Parameters:
placeIDThe Google Place ID for this waypoint.
titleA string representing the name of the waypoint.
Returns:
An instance of GMSNavigationWaypoint, or nil if the Place ID string is nil or empty.
- (nullable instancetype) initWithLocation: (CLLocationCoordinate2D)  location
title: (NSString *)  title
preferSameSideOfRoad: (BOOL)  preferSameSideOfRoad 

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

Parameters:
locationThe latitude and longitude of the waypoint.
titleA string representing the name of the waypoint.
preferSameSideOfRoadWhether 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.
Returns:
An instance of GMSNavigationWaypoint, or nil if the location is not valid.
- (nullable instancetype) initWithLocation: (CLLocationCoordinate2D)  location
title: (NSString *)  title
preferredSegmentHeading: (int32_t)  preferredSegmentHeading 

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

Parameters:
locationThe latitude and longitude of the waypoint.
titleA string representing the name of the waypoint.
preferredSegmentHeadingAn 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.
Returns:
An instance of GMSNavigationWaypoint, or nil if the location or the preferredSegmentHeading is not valid.

Returns a copy of this waypoint.

Returns a mutable copy of this waypoint.


Property Documentation

- (NSString*) title [read, assign]

The name of the waypoint.

- (CLLocationCoordinate2D) coordinate [read, assign]

The coordinates of the waypoint.

This is kCLLocationCoordinate2DInvalid if this waypoint was initialized from a Place ID.

- (NSString*) placeID [read, copy]

The Place ID of this waypoint.

This is nil if this waypoint was initialized from coordinates.

- (BOOL) preferSameSideOfRoad [read, assign]

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.

Implemented in GMSNavigationMutableWaypoint.

- (int32_t) preferredHeading [read, assign]

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.

Implemented in GMSNavigationMutableWaypoint.

- (BOOL) vehicleStopover [read, assign]

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.

Implemented in GMSNavigationMutableWaypoint.