# GMSNavigationLayoutDelegate

    @protocol GMSNavigationLayoutDelegate <NSObject>

<br />

<br />

> [!WARNING]
> [Experimental](https://developers.google.com/maps/launch-stages#experimental) feature

<br />

<br />

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.
- `


  ### [-enableNavigationUIOnMap:newState:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)enableNavigationUIOnMap:newState:)


  ` 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: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newState: any NavigationReadyUIState)

  Objective-C

      - (void)enableNavigationUIOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                             newState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationReadyUIState.html>)newState;

- `


  ### [-disableNavigationUIOnMap:oldState:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)disableNavigationUIOnMap:oldState:)


  ` The layout delegate should remove all navigation-related UI elements from the view hierarchy.

  #### Declaration

  Swift

      @MainActor optional func disableNavigationUI(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, oldState: any NavigationReadyUIState)

  Objective-C

      - (void)disableNavigationUIOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                              oldState:
                                  (nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationReadyUIState.html>)oldState;

- `


  ### [-startGuidanceOnMap:newState:oldState:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)startGuidanceOnMap:newState:oldState:)


  ` The layout delegate should alter the UI as desired to show active guidance.

  #### Declaration

  Swift

      @MainActor optional func startGuidance(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newState: any ActiveGuidanceUIState, oldState: any NavigationReadyUIState)

  Objective-C

      - (void)startGuidanceOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                        newState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSActiveGuidanceUIState.html>)newState
                        oldState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationReadyUIState.html>)oldState;

- `


  ### [-stopGuidanceOnMap:newState:oldState:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)stopGuidanceOnMap:newState:oldState:)


  ` The layout delegate should return the UI to the navigation-ready state.

  #### Declaration

  Swift

      @MainActor optional func stopGuidance(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newState: any NavigationReadyUIState, oldState: any ActiveGuidanceUIState)

  Objective-C

      - (void)stopGuidanceOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                       newState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationReadyUIState.html>)newState
                       oldState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSActiveGuidanceUIState.html>)oldState;

- `


  ### [-showPromptOnMap:newPrompt:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)showPromptOnMap:newPrompt:)


  ` The layout delegate should alter the UI to accommodate showing a prompt.

  #### Declaration

  Swift

      @MainActor optional func showPrompt(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newPrompt: NavigationPromptView)

  Objective-C

      - (void)showPromptOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                    newPrompt:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationPromptView.html)newPrompt;

- `


  ### [-hidePromptOnMap:oldPrompt:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)hidePromptOnMap:oldPrompt:)


  ` The layout delegate should remove the prompt from the screen.

  #### Declaration

  Swift

      @MainActor optional func hidePrompt(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, oldPrompt: NavigationPromptView)

  Objective-C

      - (void)hidePromptOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                    oldPrompt:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationPromptView.html)oldPrompt;

- `


  ### [-changePromptOnMap:newPrompt:oldPrompt:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)changePromptOnMap:newPrompt:oldPrompt:)


  ` The layout delegate should replace the old prompt with the new prompt.

  #### Declaration

  Swift

      @MainActor optional func changePrompt(navMap mapView: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newPrompt: NavigationPromptView, oldPrompt: NavigationPromptView)

  Objective-C

      - (void)changePromptOnMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                      newPrompt:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationPromptView.html)newPrompt
                      oldPrompt:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationPromptView.html)oldPrompt;

- `


  ### [-sizeChangedForMap:newState:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationLayoutDelegate#/c:objc(pl)GMSNavigationLayoutDelegate(im)sizeChangedForMap:newState:)


  ` 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: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html, newState: any NavigationUIState)

  Objective-C

      - (void)sizeChangedForMap:(nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                       newState:(nonnull id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSNavigationUIState.html>)newState;