AI-generated Key Takeaways
-
GMSNavigationTravelMode
defines different travel modes for navigation, including driving, cycling, walking, two-wheeler, and taxicab. -
Each travel mode determines the type of route fetched and how user course is reported (based on direction of movement or compass direction).
-
Driving, two-wheeler, and taxicab modes use the direction of movement for user course, while cycling and walking modes rely on the compass direction.
-
Developers can select the appropriate travel mode to optimize navigation for different transportation methods.
GMSNavigationTravelMode
enum GMSNavigationTravelMode : NSInteger {}
The different travel modes that can be used for navigation.
-
Driving routes will be fetched, and the reported user course will be based on the direction of movement.
Declaration
Swift
case driving = 0
Objective-C
GMSNavigationTravelModeDriving = 0
-
Cycling routes will be fetched, and the reported user course will be based on the compass direction the device is facing.
Note: During cycling navigation, the chevron always points in the direction that the user’s device is facing (toward the top of the device in landscape mode). Keep in mind that when testing with an emulator, neither the chevron direction nor the map orientation will appear to change. However, when using a physical device, the map orientation will change when the device is rotated, while the chevron continues to point in the direction that the device is facing.
Declaration
Swift
case cycling = 1
Objective-C
GMSNavigationTravelModeCycling
-
Walking routes will be fetched, and the reported user course will be based on the compass direction the device is facing.
Note: During walking navigation, the chevron always points in the direction that the user’s device is facing (toward the top of the device in landscape mode). Keep in mind that when testing with an emulator, neither the chevron direction nor the map orientation will appear to change. However, when using a physical device, the map orientation will change when the device is rotated, while the chevron continues to point in the direction that the device is facing.
Declaration
Swift
case walking = 2
Objective-C
GMSNavigationTravelModeWalking
-
Two-wheeler routes will be fetched, and the reported user course will be based on the direction of movement.
Declaration
Swift
case twoWheeler = 3
Objective-C
GMSNavigationTravelModeTwoWheeler
-
Taxicab routes will be fetched, and the reported user course will be based on the direction of movement. This is an experimental feature.
Declaration
Swift
case taxicab = 4
Objective-C
GMSNavigationTravelModeTaxicab