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(_: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.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?Parameters
mapViewThe NavigationMapView.
identifierThe style identifier.
sourceThe Layer source containing the route data that this method would style.
Return Value
An MGLStyleLayer that the map applies to all routes.
-
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.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, waypointStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?Parameters
mapViewThe NavigationMapView.
identifierThe style identifier.
sourceThe Layer source containing the waypoint data that this method would style.
Return Value
An MGLStyleLayer that the map applies to all waypoints.
-
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.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, waypointSymbolStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?Parameters
mapViewThe NavigationMapView.
identifierThe style identifier.
sourceThe Layer source containing the waypoint data that this method would style.
Return Value
An MGLStyleLayer that the map applies to all waypoint symbols.
-
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.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?Parameters
mapViewThe NavigationMapView.
identifierThe style identifier.
sourceThe Layer source containing the route data that this method would style.
Return Value
An MGLStyleLayer that the map applies to the route.
-
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(_ mapView: NavigationMapView, didSelect route: Route)Parameters
mapViewThe NavigationMapView.
routeThe route that was selected.
-
Tells the receiver that a waypoint was selected.
Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, didSelect waypoint: Waypoint)Parameters
mapViewThe NavigationMapView.
waypointThe waypoint that was selected.
-
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, individualMGLPolylineobjects in anMGLShapeCollectionFeatureobject can represent traffic congestion segments. For improved performance, you should also implementnavigationMapView(_:simplifiedShapeFor:), which defines the overall route as a single feature.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, shapeFor routes: [Route]) -> MGLShape?Parameters
mapViewThe NavigationMapView.
routesThe routes that the sender is asking about. The first route will always be rendered as the main route, while all subsequent routes will be rendered as alternate routes.
Return Value
Optionally, a
MGLShapethat defines the shape of the route, ornilto use default behavior. -
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.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapView(_ mapView: NavigationMapView, simplifiedShapeFor route: Route) -> MGLShape?Parameters
mapViewThe NavigationMapView.
routeThe route that the sender is asking about.
Return Value
Optionally, a
MGLShapethat defines the shape of the route at lower zoomlevels, ornilto use default behavior. -
navigationMapView(_:shapeFor:legIndex:)Default implementationAsks the receiver to return an MGLShape that 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(_ mapView: NavigationMapView, shapeFor waypoints: [Waypoint], legIndex: Int) -> MGLShape?Parameters
mapViewThe NavigationMapView.
waypointsThe waypoints to be displayed on the map.
Return Value
Optionally, a
MGLShapethat defines the shape of the waypoint, ornilto use default behavior. -
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.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func navigationMapViewUserAnchorPoint(_ mapView: NavigationMapView) -> CGPointParameters
mapViewThe NavigationMapView.
Return Value
A CGPoint (in regular coordinate-space) that represents the point on-screen where the user location icon should be drawn.
Install in Dash
NavigationMapViewDelegate Protocol Reference