NavigationViewControllerDelegate
public protocol NavigationViewControllerDelegateThe NavigationViewControllerDelegate provides methods for configuring the map view shown by a NavigationViewController and responding to the cancellation of a navigation session.
- 
                  
                  Called when the user exits a route and dismisses the navigation view controller by tapping the Cancel button. DeclarationSwift @objc optional func navigationViewControllerDidCancelNavigation(_ navigationViewController : NavigationViewController)
- 
                  
                  Called when the user arrives at the destination. DeclarationSwift @objc optional func navigationViewController(_ navigationViewController : NavigationViewController, didArriveAt destination: MGLAnnotation)
- 
                  
                  Returns whether the navigation view controller should be allowed to calculate a new route. If implemented, this method is called as soon as the navigation view controller detects that the user is off the predetermined route. Implement this method to conditionally prevent rerouting. If this method returns true,navigationViewController(_:willRerouteFrom:)will be called immediately afterwards.DeclarationSwift optional func navigationViewController(_ navigationViewController: NavigationViewController, shouldRerouteFrom location: CLLocation) -> BoolParametersnavigationViewControllerThe navigation view controller that has detected the need to calculate a new route. locationThe user’s current location. Return ValueTrue to allow the navigation view controller to calculate a new route; false to keep tracking the current route. 
- 
                  
                  Called immediately before the navigation view controller calculates a new route. This method is called after navigationViewController(_:shouldRerouteFrom:)is called, simultaneously with theRouteControllerWillReroutenotification being posted, and beforenavigationViewController(_:didRerouteAlong:)is called.DeclarationSwift optional func navigationViewController(_ navigationViewController: NavigationViewController, willRerouteFrom location: CLLocation)ParametersnavigationViewControllerThe navigation view controller that will calculate a new route. locationThe user’s current location. 
- 
                  
                  Called immediately after the navigation view controller receives a new route. This method is called after navigationViewController(_:willRerouteFrom:)and simultaneously with theRouteControllerDidReroutenotification being posted.DeclarationSwift optional func navigationViewController(_ navigationViewController: NavigationViewController, didRerouteAlong route: Route)ParametersnavigationViewControllerThe navigation view controller that has calculated a new route. routeThe new route. 
- 
                  
                  Called when the navigation view controller fails to receive a new route. This method is called after navigationViewController(_:willRerouteFrom:)and simultaneously with theRouteControllerDidFailToReroutenotification being posted.DeclarationSwift optional func navigationViewController(_ navigationViewController: NavigationViewController, didFailToRerouteWith error: Error)ParametersnavigationViewControllerThe navigation view controller that has calculated a new route. errorAn error raised during the process of obtaining a new route. 
- 
                  
                  Returns an MGLStyleLayerthat determines the appearance of the route line.If this method is unimplemented, the navigation map view draws the route line using an MGLLineStyleLayer.DeclarationSwift @objc optional func navigationMapView(_ mapView: NavigationMapView, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
- 
                  
                  Returns an MGLStyleLayerthat determines the appearance of the route line’s casing.If this method is unimplemented, the navigation map view draws the route line’s casing using an MGLLineStyleLayerwhose width is greater than that of the style layer returned bynavigationMapView(_:routeStyleLayerWithIdentifier:source:).DeclarationSwift @objc optional func navigationMapView(_ mapView: NavigationMapView, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
- 
                  
                  Returns an MGLShapethat represents the path of the route line.If this method is unimplemented, the navigation map view represents the route line using an MGLPolylineFeaturebased onroute’scoordinatesproperty.DeclarationSwift @objc optional func navigationMapView(_ mapView: NavigationMapView, shapeDescribing route: Route) -> MGLShape?
- 
                  
                  Returns an MGLShapethat represents the path of the route line’s casing.If this method is unimplemented, the navigation map view represents the route line’s casing using an MGLPolylineFeatureidentical to the one returned bynavigationMapView(_:shapeDescribing:).DeclarationSwift @objc optional func navigationMapView(_ mapView: NavigationMapView, simplifiedShapeDescribing route: Route) -> MGLShape?
- 
                  
                  Return an MGLAnnotationImagethat represents the destination marker.If this method is unimplemented, the navigation map view will represent the destination annotation with the default marker. DeclarationSwift @objc optional func navigationMapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage?
 Install in Dash
              Install in Dash
             NavigationViewControllerDelegate Protocol Reference
        NavigationViewControllerDelegate Protocol Reference