NavigationMapView

open class NavigationMapView: MGLMapView, UIGestureRecognizerDelegate

NavigationMapView is a subclass of MGLMapView with convenience functions for adding Route lines to a map.

  • Determines whether the map should follow the user location and rotate when the course changes.

    Seealso

    NavigationMapViewCourseTrackingDelegate

    Declaration

    Swift

    open var tracksUserCourse: Bool = false
  • A UIView used to indicate the user’s location and course on the map.

    If the view conforms to UserCourseView, its UserCourseView.update(location:pitch:direction:animated:) method is frequently called to ensure that its visual appearance matches the map’s camera.

    Declaration

    Swift

    @objc public var userCourseView: UIView?
  • Attempts to localize road labels into the local language and other labels into the system’s preferred language.

    When this property is enabled, the style automatically modifies the text property of any symbol style layer whose source is the Mapbox Streets source. On iOS, the user can set the system’s preferred language in Settings, General Settings, Language & Region.

    Unlike the MGLStyle.localizeLabels(into:) method, this method localizes road labels into the local language, regardless of the system’s preferred language, in an effort to match road signage. The turn banner always displays road names and exit destinations in the local language, so you should call this method in the MGLMapViewDelegate.mapView(_:didFinishLoading:) method of any delegate of a standalone NavigationMapView. The map view embedded in NavigationViewController is localized automatically, so you do not need to call this method on the value of NavigationViewController.mapView.

    Declaration

    Swift

    @objc public func localizeLabels()
  • Sets the camera directly over a series of coordinates.

    Declaration

    Swift

    @objc public func setOverheadCameraView(from userLocation: CLLocationCoordinate2D, along coordinates: [CLLocationCoordinate2D], for bounds: UIEdgeInsets)