NavigationMapViewDelegate

public protocol NavigationMapViewDelegate : AnyObject, UnimplementedLogging

The NavigationMapViewDelegate provides methods for configuring the NavigationMapView, as well as responding to events triggered by the NavigationMapView.

  • Asks the receiver to return a CircleLayer for waypoints, given an identifier and source. This method is invoked any time waypoints are added or shown.

    Default Implementation

    UnimplementedLogging prints 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

    navigationMapView
    identifier

    The style identifier.

    source

    The Layer source containing the waypoint data that this method would style.

    Return Value

    A CircleLayer that the map applies to all waypoints.

  • Asks the receiver to return a SymbolLayer for waypoint symbols, given an identifier and source. This method is invoked any time waypoints are added or shown.

    Default Implementation

    UnimplementedLogging prints 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

    navigationMapView
    identifier

    The style identifier.

    source

    The Layer source containing the waypoint data that this method would style.

    Return Value

    A SymbolLayer that the map applies to all waypoint symbols.

  • navigationMapView(_:didSelect:) Default implementation

    Tells the receiver that the user has selected a route by interacting with the map view.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func navigationMapView(_ navigationMapView: NavigationMapView, didSelect route: Route)

    Parameters

    navigationMapView
    route

    The route that was selected.

  • Tells the receiver that a waypoint was selected.

    Declaration

    Swift

    func navigationMapView(_ navigationMapView: NavigationMapView, didSelect waypoint: Waypoint)

    Parameters

    navigationMapView
    waypoint

    The waypoint that was selected.

  • Asks the receiver to return a FeatureCollection that describes the geometry of the waypoint.

    Default Implementation

    UnimplementedLogging prints 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

    navigationMapView
    waypoints

    The waypoints to be displayed on the map.

    Return Value

    Optionally, a FeatureCollection that defines the shape of the waypoint, or nil to use default behavior.

  • navigationMapViewUserAnchorPoint(_:) Default implementation

    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.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func navigationMapViewUserAnchorPoint(_ navigationMapView: NavigationMapView) -> CGPoint

    Parameters

    navigationMapView

    Return Value

    A CGPoint (in regular coordinate-space) that represents the point on-screen where the user location icon should be drawn.