GMSNavigationLayoutDelegate
@protocol GMSNavigationLayoutDelegate <NSObject>The protocol that layout delegates must implement in order to take control of the layout of the map container during navigation-ready or active guidance modes.
Since the purpose of these methods is to modify the view hierarchy, all methods are MainActor- restricted. The protocol itself is not MainActor-restricted, since implementations may have other non-MainActor methods.
-
The layout delegate should add UI elements for the navigation-ready state to the view hierarchy and ensure they are laid out appropriately.
Declaration
Swift
@MainActor optional func enableNavigationUI(navMap mapView: GMSMapView, newState: any NavigationReadyUIState)Objective-C
- (void)enableNavigationUIOnMap:(nonnull GMSMapView *)mapView newState:(nonnull id<GMSNavigationReadyUIState>)newState; -
The layout delegate should remove all navigation-related UI elements from the view hierarchy.
Declaration
Swift
@MainActor optional func disableNavigationUI(navMap mapView: GMSMapView, oldState: any NavigationReadyUIState)Objective-C
- (void)disableNavigationUIOnMap:(nonnull GMSMapView *)mapView oldState: (nonnull id<GMSNavigationReadyUIState>)oldState; -
The layout delegate should alter the UI as desired to show active guidance.
Declaration
Swift
@MainActor optional func startGuidance(navMap mapView: GMSMapView, newState: any ActiveGuidanceUIState, oldState: any NavigationReadyUIState)Objective-C
- (void)startGuidanceOnMap:(nonnull GMSMapView *)mapView newState:(nonnull id<GMSActiveGuidanceUIState>)newState oldState:(nonnull id<GMSNavigationReadyUIState>)oldState; -
The layout delegate should return the UI to the navigation-ready state.
Declaration
Swift
@MainActor optional func stopGuidance(navMap mapView: GMSMapView, newState: any NavigationReadyUIState, oldState: any ActiveGuidanceUIState)Objective-C
- (void)stopGuidanceOnMap:(nonnull GMSMapView *)mapView newState:(nonnull id<GMSNavigationReadyUIState>)newState oldState:(nonnull id<GMSActiveGuidanceUIState>)oldState; -
The layout delegate should alter the UI to accommodate showing a prompt.
Declaration
Swift
@MainActor optional func showPrompt(navMap mapView: GMSMapView, newPrompt: NavigationPromptView)Objective-C
- (void)showPromptOnMap:(nonnull GMSMapView *)mapView newPrompt:(nonnull GMSNavigationPromptView)newPrompt; -
The layout delegate should remove the prompt from the screen.
Declaration
Swift
@MainActor optional func hidePrompt(navMap mapView: GMSMapView, oldPrompt: NavigationPromptView)Objective-C
- (void)hidePromptOnMap:(nonnull GMSMapView *)mapView oldPrompt:(nonnull GMSNavigationPromptView)oldPrompt; -
The layout delegate should replace the old prompt with the new prompt.
Declaration
Swift
@MainActor optional func changePrompt(navMap mapView: GMSMapView, newPrompt: NavigationPromptView, oldPrompt: NavigationPromptView)Objective-C
- (void)changePromptOnMap:(nonnull GMSMapView *)mapView newPrompt:(nonnull GMSNavigationPromptView)newPrompt oldPrompt:(nonnull GMSNavigationPromptView)oldPrompt; -
This method is called when the size of the GMSMapView object has changed.
A change in the size of the container may mean NavSDK has decided on a different value of the wideMode variable (see above). On iOS only, device rotation will result in a a call to this method.
Declaration
Swift
@MainActor optional func sizeChanged(navMap mapView: GMSMapView, newState: any NavigationUIState)Objective-C
- (void)sizeChangedForMap:(nonnull GMSMapView *)mapView newState:(nonnull id<GMSNavigationUIState>)newState;