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.
-
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 anCongestionLevel.unknowntraffic congestion level and a matchingMapboxDirections.MapboxStreetsRoadClasswill be replaced with theCongestionLevel.lowcongestion level.Declaration
Swift
public var roadClassesWithOverriddenCongestionLevels: Set<MapboxStreetsRoadClass>? -
MapView, which is added on top ofNavigationMapViewand 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
NavigationMapViewCourseTrackingDelegateDeclaration
Swift
open var tracksUserCourse: Bool { get set } -
A type that represents a
UIViewthat isCourseUpdatable.Declaration
Swift
public typealias UserCourseView = UIView & CourseUpdatable -
A
UserCourseViewused to indicate the user’s location and course on the map.The
UserCourseView‘sUserCourseView.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 }
-
Updates the map view’s preferred frames per second to the appropriate value for the current route progress.
This method accounts for the proximity to a maneuver and the current power source. It has no effect if
tracksUserCourseis set totrue.Declaration
Swift
open func updatePreferredFrameRate(for routeProgress: RouteProgress) -
Track position on a frame by frame basis. Used for first location update and when resuming tracking mode
Declaration
Swift
public func enableFrameByFrameCourseViewTracking(for duration: TimeInterval)
-
Showcases route array. Adds routes and waypoints to map, and sets camera to point encompassing the route.
Declaration
Swift
public static let defaultPadding: UIEdgeInsets -
Adds the route waypoints to the map given the current leg index. Previous waypoints for completed legs will be omitted.
Declaration
Swift
public func showWaypoints(on route: Route, legIndex: Int = 0) -
Shows the step arrow given the current
RouteProgress.Declaration
Swift
public func addArrow(route: Route, legIndex: Int, stepIndex: Int) -
Removes the step arrow from the map.
Declaration
Swift
public func removeArrow() -
Sets the camera directly over a series of coordinates.
Declaration
Swift
public func setOverheadCameraView(from userLocation: CLLocation, along lineString: LineString, for padding: UIEdgeInsets) -
Recenters the camera and begins tracking the user’s location.
Declaration
Swift
public func recenterMap()
-
Receives coordinates for searching the map for buildings. If buildings are found, they will be highlighted in 2D or 3D depending on the
in3Dvalue.Declaration
Swift
@discardableResult public func highlightBuildings(at coordinates: [CLLocationCoordinate2D], in3D extrudesBuildings: Bool = true) -> BoolParameters
coordinatesCoordinates which represent building locations.
extrudesBuildingsSwitch which allows to highlight buildings in either 2D or 3D. Defaults to true.
Return Value
Bool indicating if number of buildings found equals number of coordinates supplied.
-
Removes the highlight from all buildings highlighted by
highlightBuildings(at:in3D:).Declaration
Swift
public func unhighlightBuildings()
-
Find and cache the index of the upcoming [RouteLineDistancesIndex].
Declaration
Swift
public func updateUpcomingRoutePointIndex(routeProgress: RouteProgress) -
Updates the route style layer and its casing style layer to gradually disappear as the user location puck travels along the displayed route.
Declaration
Swift
public func updateRoute(_ routeProgress: RouteProgress)Parameters
routeProgressCurrent route progress.
Install in Dash
NavigationMapView Class Reference