NavigationMapViewDelegate
public protocol NavigationMapViewDelegate : AnyObject, UnimplementedLogging
The NavigationMapViewDelegate provides methods for configuring the NavigationMapView, as well as responding to events triggered by the NavigationMapView.
-
navigationMapView(_:routeLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor the route line, given a layer identifier and a source identifier. This method is invoked when the map view loads and any time routes are added.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, routeLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer?Parameters
navigationMapViewThe
NavigationMapViewobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied to the route line. -
navigationMapView(_:routeCasingLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor the casing layer that surrounds route line, given a layer identifier and a source identifier. This method is invoked when the map view loads and any time routes are added.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, routeCasingLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer?Parameters
navigationMapViewThe
NavigationMapViewobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied as a casing around the route line. -
navigationMapView(_:routeRestrictedAreasLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor highlighting restricted areas portions of the route, given a layer identifier and a source identifier. This method is invoked whenshowsRestrictedAreasOnRouteis enabled, the map view loads and any time routes are added.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, routeRestrictedAreasLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer?Parameters
navigationMapViewThe
NavigationMapViewobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied as restricted areas on the route line. -
navigationMapView(_:willAdd:)Default implementationAsks the receiver to adjust the default layer which will be added to the map view and return a
Layer. This method is invoked when the map view loads and any time a layer will be added.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, willAdd layer: Layer) -> Layer?Parameters
navigationMapViewThe
NavigationMapViewobject.layerA default
Layergenerated by the navigationMapView.Return Value
A
Layerafter adjusted and will be added to the map view byMapboxNavigation. -
navigationMapView(_:shapeFor:)Default implementationAsks the receiver to return an
LineStringthat describes the geometry of the route. ResultingLineStringwill then be styled usingNavigationMapView.navigationMapView(_:routeLineLayerWithIdentifier:sourceIdentifier:)provided style or a default congestion style if above delegate method was not implemented.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, shapeFor route: Route) -> LineString?Parameters
navigationMapViewThe
NavigationMapView.routeThe route that the sender is asking about.
Return Value
A
LineStringobject that defines the shape of the route, ornilin case of default behavior. -
navigationMapView(_:casingShapeFor:)Default implementationAsks the receiver to return an
LineStringthat describes the geometry of the route casing. ResultingLineStringwill then be styled usingNavigationMapView.navigationMapView(_:routeCasingLineLayerWithIdentifier:sourceIdentifier:)provided style or a default style if above delegate method was not implemented.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, casingShapeFor route: Route) -> LineString?Parameters
navigationMapViewThe
NavigationMapView.routeThe route that the sender is asking about.
Return Value
A
LineStringobject that defines the shape of the route casing, ornilin case of default behavior. -
navigationMapView(_:restrictedAreasShapeFor:)Default implementationAsks the receiver to return an
LineStringthat describes the geometry of the route restricted areas. ResultingLineStringwill then be styled usingNavigationMapView.navigationMapView(_:routeRestrictedAreasLineLayerWithIdentifier:sourceIdentifier:)provided style or a default style if above delegate method was not implemented.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, restrictedAreasShapeFor route: Route) -> LineString?Parameters
navigationMapViewThe
NavigationMapView.routeThe route that the sender is asking about.
Return Value
A
LineStringobject that defines the shape of the route restricted areas, ornilin case of default behavior.
-
navigationMapView(_:waypointCircleLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
CircleLayerfor waypoints, given an identifier and source. This method is invoked any time waypoints are added or shown.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, waypointCircleLayerWithIdentifier identifier: String, sourceIdentifier: String) -> CircleLayer?Parameters
navigationMapViewThe
NavigationMapViewobject.identifierThe
CircleLayeridentifier.sourceIdentifierIdentifier of the source, which contains the waypoint data that this method would style.
Return Value
A
CircleLayerthat the map applies to all waypoints. -
navigationMapView(_:waypointSymbolLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
SymbolLayerfor waypoint symbols, given an identifier and source. This method is invoked any time waypoints are added or shown.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, waypointSymbolLayerWithIdentifier identifier: String, sourceIdentifier: String) -> SymbolLayer?Parameters
navigationMapViewThe
NavigationMapViewobject.identifierThe
SymbolLayeridentifier.sourceIdentifierIdentifier of the source, which contains the waypoint data that this method would style.
Return Value
A
SymbolLayerthat the map applies to all waypoint symbols. -
navigationMapView(_:shapeFor:legIndex:)Default implementationAsks the receiver to return a
FeatureCollectionthat describes the geometry of the waypoint.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, shapeFor waypoints: [Waypoint], legIndex: Int) -> FeatureCollection?Parameters
navigationMapViewThe
NavigationMapView.waypointsThe waypoints to be displayed on the map.
legIndexReturn Value
Optionally, a
FeatureCollectionthat defines the shape of the waypoint, ornilto use default behavior.
-
navigationMapView(_:didSelect:)Default implementationTells the receiver that the user has selected a route by interacting with the map view.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, didSelect route: Route)Parameters
navigationMapViewThe
NavigationMapView.routeThe route that was selected.
-
Tells the receiver that the user has selected a continuous alternative route by interacting with the map view.
Continuous alternatives are all non-primary routes, reported during the navigation session.
Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, didSelect continuousAlternative: AlternativeRoute)Parameters
navigationMapViewThe
NavigationMapView.continuousAlternativeThe route that was selected.
-
Tells the receiver that a waypoint was selected.
Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, didSelect waypoint: Waypoint)Parameters
navigationMapViewThe
NavigationMapView.waypointThe waypoint that was selected.
-
navigationMapView(_:didAdd:pointAnnotationManager:)Default implementationTells the receiver that the final destination
PointAnnotationwas added to theNavigationMapView.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ navigationMapView: NavigationMapView, didAdd finalDestinationAnnotation: PointAnnotation, pointAnnotationManager: PointAnnotationManager)Parameters
navigationMapViewThe
NavigationMapViewobject.finalDestinationAnnotationThe point annotation that was added to the map view.
pointAnnotationManagerThe object that manages the point annotation in the map view.
Install in Dash
NavigationMapViewDelegate Protocol Reference