NavigationMapViewDelegate
The NavigationMapViewDelegate
provides methods for configuring the NavigationMapView, as well as responding to events triggered by the NavigationMapView.
-
Asks 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.
-
Asks 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.
-
Asks 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.
-
Asks 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. -
Tells the receiver that the user has selected a route by interacting with the map view.
-
Asks 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. -
Asks 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. -
Asks the receiver to return an MGLShape that describes the geometry of the waypoint.
-
Asks the receiver to return an MGLAnnotationImage that describes the image used an annotation.
-
Asks the receiver to return an MGLAnnotationView that describes the image used an annotation.
-
Asks 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.