MMKNavigation
class MMKNavigation : NSObject |
Undocumented
Summary
Instance methods
func requestRoutes(with points: [MMKRequestPoint], |
func requestAlternatives() |
func resolveUri(withUri uri: String) |
func cancelRequest() |
func resetRoutes() |
func addListener(with navigationListener: MMKNavigationListener) |
func removeListener(with navigationListener: MMKNavigationListener) |
func startGuidance(with route: MMKDrivingRoute?) |
func stopGuidance() |
func suspend() |
func resume() |
Properties
var vehicleOptions: MMKDrivingVehicleOptions { get set } |
var isAvoidTolls: Bool { get set } |
var isAvoidUnpaved: Bool { get set } |
var isAvoidPoorConditions: Bool { get set } |
var avoidedZones: [MMKLinearRing] { get set } |
var annotationLanguage: MMKAnnotationLanguage { get set } |
var routes: [MMKDrivingRoute] { get } |
var guidance: MMKGuidance { get } |
Instance methods
requestRoutes(with:initialAzimuth:routesCount:)
func requestRoutes(with points: [MMKRequestPoint], |
Request routes for further guidance. If there was a pending routing request, it will be canceled.
requestAlternatives()
func requestAlternatives() |
Request global alternatives for the current route. If there was a pending routing request, it will be canceled.
resolveUri(withUri:)
func resolveUri(withUri uri: String) |
Resolve saved driving route URI for further guidance. If there was a pending routing request, it will be canceled.
cancelRequest()
func cancelRequest() |
Cancel active routing request.
resetRoutes()
func resetRoutes() |
Cancel active routing request and clear routes vector.
addListener(with:)
func addListener(with navigationListener: MMKNavigationListener) |
The class does not retain the object in the 'navigationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeListener(with:)
func removeListener(with navigationListener: MMKNavigationListener) |
Undocumented
startGuidance(with:)
func startGuidance(with route: MMKDrivingRoute?) |
Start guidance with given route. This method will reset active current route if any. It only accepts either routes obtained from this routes
field or null
, which means freedrive session started.
stopGuidance()
func stopGuidance() |
Stops current guidance session. Call this method only if guidance has completely ended. For example, if you need to start another type of guidance (pedestrian for example) stop this first and than start another one. In case of route finished but you still on the road you must use startGuidance(null)
instead.
suspend()
func suspend() |
Stop tracking user position, later it could be resumed without losing current route. Useful when user don't want guidance in background.
resume()
func resume() |
Resumes suspended guidance. Guide will continue to guide the previous route or rebuild it. Useful when user don't want guidance in background.
Properties
vehicleOptions
var vehicleOptions: MMKDrivingVehicleOptions { get set } |
Changing this option may trigger reroute.
isAvoidTolls
var isAvoidTolls: Bool { get set } |
The 'avoidTolls/avoidUnpaved/avoidPoorConditions' option instructs the router to return routes that avoid tolls/unpaved/roads in poor condition when possible. Changing these options may trigger reroute. All disabled by default.
isAvoidUnpaved
var isAvoidUnpaved: Bool { get set } |
Undocumented
isAvoidPoorConditions
var isAvoidPoorConditions: Bool { get set } |
Undocumented
avoidedZones
var avoidedZones: [MMKLinearRing] { get set } |
avoidedZones instructs the router to return routes that avoid provided polygons. If there are too many polygons or too complex polygon geometry, routes building may become impossible. In this case the error MMKDrivingTooComplexAvoidedZonesError will be returned. Changing this option may trigger reroute.
annotationLanguage
var annotationLanguage: MMKAnnotationLanguage { get set } |
Set the annotation language. Changing this option may trigger reroute.
routes
var routes: [MMKDrivingRoute] { get } |
Resulting routes for the previous request. For requestAlternatives() it will contain the current route and fastest alternative route (if available) along with the received alternatives. Current route always will be the first one and fastest alternative will be the second.
guidance
var guidance: MMKGuidance { get } |
Undocumented