NavigationMapViewDelegate
The NavigationMapViewDelegate
provides methods for configuring the NavigationMapView, as well as responding to events triggered by the NavigationMapView.
-
navigationMapView(_:routeStyleLayerWithIdentifier:source:)
Default implementationAsks the receiver to return an MGLStyleLayer for routes, given an identifier and source. This method is invoked when the map view loads and any time routes are added.
Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:waypointStyleLayerWithIdentifier:source:)
Default implementationAsks the receiver to return an MGLStyleLayer for waypoints, given an identifier and source. This method is invoked when the map view loads and any time waypoints are added.
Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:waypointSymbolStyleLayerWithIdentifier:source:)
Default implementationAsks the receiver to return an MGLStyleLayer for waypoint symbols, given an identifier and source. This method is invoked when the map view loads and any time waypoints are added.
Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:routeCasingStyleLayerWithIdentifier:source:)
Default implementationAsks the receiver to return an MGLStyleLayer for route casings, given an identifier and source. This method is invoked when the map view loads and anytime routes are added.
Note
Specify a casing to ensure good contrast between the route line and the underlying map layers.Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:didSelect:)
Default implementationTells the receiver that the user has selected a route by interacting with the map view.
Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:shapeFor:)
Default implementationAsks the receiver to return an MGLShape that describes the geometry of the route.
Note
The returned value represents the route in full detail. For example, individualMGLPolyline
objects in anMGLShapeCollectionFeature
object can represent traffic congestion segments. For improved performance, you should also implementnavigationMapView(_:simplifiedShapeFor:)
, which defines the overall route as a single feature.Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:simplifiedShapeFor:)
Default implementationAsks the receiver to return an MGLShape that describes the geometry of the route at lower zoomlevels.
Note
The returned value represents the simplfied route. It is designed to be used with `navigationMapView(_:shapeFor:), and if used without its parent method, can cause unexpected behavior.Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapView(_:shapeFor:legIndex:)
Default implementationAsks the receiver to return an MGLShape that describes the geometry of the waypoint.
Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation
-
navigationMapViewUserAnchorPoint(_:)
Default implementationAsks the receiver to return a CGPoint to serve as the anchor for the user icon.
Important
The return value should be returned in the normal UIKit coordinate-space, NOT CoreAnimation’s unit coordinate-space.Note
This delegate method includes a default implementation that prints a warning to the console when this method is called. SeeUnimplementedLogging
for details.Default Implementation