NavigationMapView

open class NavigationMapView : UIView

NavigationMapView is a subclass of UIView, which draws MapView on its surface and provides convenience functions for adding Route lines to a map.

  • The minimum preferred frames per second at which to render map animations.

    This property takes effect when the application has limited resources for animation, such as when the device is running on battery power. By default, this property is set to PreferredFPS.normal.

    Declaration

    Swift

    public var minimumFramesPerSecond: PreferredFPS
  • Returns the altitude that the map camera initally defaults to.

    Declaration

    Swift

    public var defaultAltitude: CLLocationDistance
  • Returns the altitude the map conditionally zooms out to when user is on a motorway, and the maneuver length is sufficently long.

    Declaration

    Swift

    public var zoomedOutMotorwayAltitude: CLLocationDistance
  • Returns the threshold for what the map considers a “long-enough” maneuver distance to trigger a zoom-out when the user enters a motorway.

    Declaration

    Swift

    public var longManeuverDistance: CLLocationDistance
  • Maximum distance the user can tap for a selection to be valid when selecting an alternate route.

    Declaration

    Swift

    public var tapGestureDistanceThreshold: CGFloat
  • A collection of street road classes for which a congestion level substitution should occur.

    For any street road class included in the roadClassesWithOverriddenCongestionLevels, all route segments with an CongestionLevel.unknown traffic congestion level and a matching MapboxDirections.MapboxStreetsRoadClass will be replaced with the CongestionLevel.low congestion level.

    Declaration

    Swift

    public var roadClassesWithOverriddenCongestionLevels: Set<MapboxStreetsRoadClass>?
  • Controls whether to show congestion levels on alternative route lines. Defaults to false.

    If true and there’re multiple routes to choose, the alternative route lines would display the congestion levels at different colors, similar to the main route. To customize the congestion colors that represent different congestion levels, override the alternativeTrafficUnknownColor, alternativeTrafficLowColor, alternativeTrafficModerateColor, alternativeTrafficHeavyColor, alternativeTrafficSevereColor property for the NavigationMapView.appearance().

    Declaration

    Swift

    public var showsCongestionForAlternativeRoutes: Bool
  • MapView, which is added on top of NavigationMapView and allows to render navigation related components.

    Declaration

    Swift

    public private(set) var mapView: MapView! { get }
  • The object that acts as the navigation delegate of the map view.

    Declaration

    Swift

    public weak var delegate: NavigationMapViewDelegate?
  • The object that acts as the course tracking delegate of the map view.

    Declaration

    Swift

    public weak var courseTrackingDelegate: NavigationMapViewCourseTrackingDelegate?
  • Determines whether the map should follow the user location and rotate when the course changes.

    Seealso

    NavigationMapViewCourseTrackingDelegate

    Declaration

    Swift

    open var tracksUserCourse: Bool { get set }
  • A type that represents a UIView that is CourseUpdatable.

    Declaration

    Swift

    public typealias UserCourseView = UIView & CourseUpdatable
  • A UserCourseView used to indicate the user’s location and course on the map.

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

    Declaration

    Swift

    public var userCourseView: UserCourseView { get set }
  • Setups the Predictive Caching mechanism using provided Options.

    This will handle all the required manipulations to enable the feature and maintain it during the navigations. Once enabled, it will be present as long as NavigationMapView is retained.

    Declaration

    Swift

    public func enablePredictiveCaching(options predictiveCacheOptions: PredictiveCacheOptions)

    Parameters

    options

    options, controlling caching parameters like area radius and concurrent downloading threads.

  • Receives coordinates for searching the map for buildings. If buildings are found, they will be highlighted in 2D or 3D depending on the in3D value.

    Declaration

    Swift

    public func highlightBuildings(at coordinates: [CLLocationCoordinate2D],
                                   in3D extrudesBuildings: Bool = true,
                                   completion: ((_ foundAllBuildings: Bool) -> Void)? = nil)

    Parameters

    coordinates

    Coordinates which represent building locations.

    extrudesBuildings

    Switch which allows to highlight buildings in either 2D or 3D. Defaults to true.

    completion

    An escaping closure to be executed when the MapView feature querying for all coordinates ends. A single Boolean argument in closure indicates whether or not buildings were found for all coordinates.

  • Removes the highlight from all buildings highlighted by highlightBuildings(at:in3D:).

    Declaration

    Swift

    public func unhighlightBuildings()