Navmii SDK  2.2.0
Write yourself a navigation system in iOS
Instance Methods | Class Methods | Properties | List of all members
NMNavigationService Class Reference

Inherits <NSObject>.

Instance Methods

(CLAccuracyAuthorization locationServicesAccuracyAuthorizationStatus) - API_AVAILABLE
 
(nullable instancetype) - NS_UNAVAILABLE
 
(void) - startDemoRoute:
 
(void) - stopDemoRoute
 
(NMNavigationInfo *) - navigationInfo
 
(void) - requestAlwaysAuthorization
 
(void) - requestWhenInUseAuthorization
 
(void) - startUpdatingLocation
 
(void) - stopUpdatingLocation
 
(void) - startUpdatingHeading
 
(void) - stopUpdatingHeading
 
(void) - setCoordinates:course:
 
(void) - setCoordinates:course:speed:horizontalAccuracy:timeStamp:altitude:
 
(void) - snapCoordinates:heading:radiusInMeters:snappingType:completion:
 
(NMSnappingResult *) - snapCoordinates:heading:radiusInMeters:snappingType:
 
(void) - addListener:
 
(void) - removeNavigationServiceListener:
 
(void) - removeListener:
 
(void) - addTrafficOnRouteImageListener:
 
(void) - removeTrafficOnRouteImageListener:
 

Class Methods

(nullable instancetype) + NS_UNAVAILABLE
 

Properties

NMGpsStatus gpsStatus
 
CLLocationAccuracy locationDetectionAccuracy
 
CLAuthorizationStatus locationServicesAuthorizationStatus
 
BOOL allowsBackgroundLocationUpdates
 
BOOL gpsPositionExtrapolationEnabled
 
BOOL snappingGpsPositionToRoadsEnabled
 
NMPositioncurrentPosition
 
float currentCourse
 
NMTrackRecordertrackRecorder
 
BOOL isDemoRouteActive
 

Detailed Description

A class providing an API for the SDK's navigation features.

Method Documentation

◆ addListener:()

- (void) addListener: (addListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMNavigationServiceListener protocol. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMNavigationServiceListener protocol to be added to listeners.
Deprecated:
This method is deprecated.
Note
Use
addListener:
method instead. Adds a listener responding to events described in NMNavigationServiceListener protocol. You can add multiple listeners using this method.
Parameters
listenerAn object conforming to NMNavigationServiceListener protocol to be added to listeners.

◆ addTrafficOnRouteImageListener:()

- (void) addTrafficOnRouteImageListener: (addTrafficOnRouteImageListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMTrafficOnRouteImageListener protocol. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMTrafficOnRouteImageListener protocol to be added to listeners.

◆ API_AVAILABLE()

- (CLAccuracyAuthorization locationServicesAccuracyAuthorizationStatus) API_AVAILABLE (ios(14.0)) 

A value that indicates the level of location accuracy the app has permission to use.

◆ navigationInfo()

- (NMNavigationInfo *) navigationInfo

Returns the navigation information.

◆ NS_UNAVAILABLE() [1/2]

- (nullable instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE() [2/2]

+ (nullable instancetype) NS_UNAVAILABLE

◆ removeListener:()

- (void) removeListener: (removeListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMNavigationServiceListener.

Parameters
listenerAn object conforming to NMNavigationServiceListener protocol to be removed from listeners.

◆ removeNavigationServiceListener:()

- (void) removeNavigationServiceListener: ((deprecated("Use removeListener: instead")))  __attribute__

Removes a listener responding to events described in NMNavigationServiceListener.

Parameters
listenerAn object conforming to NMNavigationServiceListener protocol to be removed from listeners.
Deprecated:
This method is deprecated.
Note
Use
removeListener:
method instead.

◆ removeTrafficOnRouteImageListener:()

- (void) removeTrafficOnRouteImageListener: (removeTrafficOnRouteImageListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMTrafficOnRouteImageListener.

Parameters
listenerAn object conforming to NMTrafficOnRouteImageListener protocol to be removed from listeners.

◆ requestAlwaysAuthorization()

- (void) requestAlwaysAuthorization

When authorization status is not determined, calling this method will trigger a prompt to request "Always" authorization from the user. You must call this method or the requestWhenInUseAuthorization before Navmii SDK can receive location-related information. To call this method, you must have both NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription keys in your app’s Info.plist file. After the user makes a selection and determines the status, the navigation service delivers the results to either the listener's NMNavigationServiceListener::onLocationServicesAuthorizationStatusChanged method or the listener's NMNavigationServiceListener::onLocationServicesDidChangeAuthorization depending on the current version of the operating system.

◆ requestWhenInUseAuthorization()

- (void) requestWhenInUseAuthorization

When authorization status is not determined, calling this method will trigger a prompt to request "While Using the App" authorization from the user. You must call this method or requestAlwaysAuthorization before Navmii SDK can receive location-related information. The user prompt contains the text from the NSLocationWhenInUseUsageDescription key in your app's Info.plist file, and the presence of that key is required when calling this method. After the user makes a selection and determines the status, the navigation service delivers the results to either the listener's NMNavigationServiceListener::onLocationServicesAuthorizationStatusChanged method or the listener's NMNavigationServiceListener::onLocationServicesDidChangeAuthorization depending on the current version of the operating system.

◆ setCoordinates:course:()

- (void) setCoordinates: (NMMapCoordinates *)  coordinates
course: (NSNumber *)  course 

Uses the specified parameters to update the position of the GPS marker on map.

Parameters
coordinatesCoordinates to be used.
courseCourse to be used.

◆ setCoordinates:course:speed:horizontalAccuracy:timeStamp:altitude:()

- (void) setCoordinates: (NMMapCoordinates *)  coordinates
course: (float)  course
speed: (float)  speed
horizontalAccuracy: (float)  horizontalAccuracy
timeStamp: (NSTimeInterval)  timeStamp
altitude: (double)  altitude 

Uses the specified parameters to update the position of the GPS marker on map.

Parameters
coordinatesCoordinates to be used.
courseCourse to be used.
speedSpeed to be used.
horizontalAccuracyHorizontalAccuracy to be used.
timeStampTimestamp to be used.
altitudeAltitude to be used.

◆ snapCoordinates:heading:radiusInMeters:snappingType:()

- (NMSnappingResult *) snapCoordinates: (NMMapCoordinates *)  coordinates
heading: (float)  heading
radiusInMeters: (float)  radiusInMeters
snappingType: (NMSnappingType snappingType 

Tries to find the road nearest to the specified coordinates within the specified radius considering the specified heading. This method performs snapping in the main thread and returns result synchroniously.

Parameters
coordinatesCoordinates to be snapped.
headingTarget heading.
radiusInMetersMaximum distance to the nearest point of the road.
snappingTypeThe type of the snapping.
Returns
The result of the snapping.

◆ snapCoordinates:heading:radiusInMeters:snappingType:completion:()

- (void) snapCoordinates: (NMMapCoordinates *)  coordinates
heading: (float)  heading
radiusInMeters: (float)  radiusInMeters
snappingType: (NMSnappingType snappingType
completion: (NMSnappingCompletion completion 

Tries to find the road nearest to the specified coordinates within the specified radius considering the specified heading. This method returns result asynchroniously.

Parameters
coordinatesCoordinates to be snapped.
headingTarget heading.
radiusInMetersMaximum distance to the nearest point of the road.
snappingTypeThe type of the snapping.
completionCompletion block throught which you'll be informed on snapping result.

◆ startDemoRoute:()

- (void) startDemoRoute: (nonnull NMRoute *)  route

Starts demo route.

◆ startUpdatingHeading()

- (void) startUpdatingHeading

Starts updating heading.

◆ startUpdatingLocation()

- (void) startUpdatingLocation

Starts receiving position updates.

◆ stopDemoRoute()

- (void) stopDemoRoute

Stops demo route.

◆ stopUpdatingHeading()

- (void) stopUpdatingHeading

Stops updating heading.

◆ stopUpdatingLocation()

- (void) stopUpdatingLocation

Stops receiving position updates.

Property Documentation

◆ allowsBackgroundLocationUpdates

- (BOOL) allowsBackgroundLocationUpdates
readwritenonatomicassign

User's location updates when in background mode. YES when allowed, NO when disallowed.

◆ currentCourse

- (float) currentCourse
readnonatomicassign

Current course of the GPS position arrow.

◆ currentPosition

- (NMPosition*) currentPosition
readnonatomiccopy

Current coordinates along with altitude, course and snapping information.

◆ gpsPositionExtrapolationEnabled

- (BOOL) gpsPositionExtrapolationEnabled
readwritenonatomicassign

Enables/disables the extrapolation of the GPS location, which results in smooth movement of GPS location marker. If disabled, GPS location marker will change it's position instantly when GPS location updates.

◆ gpsStatus

- (NMGpsStatus) gpsStatus
readnonatomicassign

GPS signal status.

◆ isDemoRouteActive

- (BOOL) isDemoRouteActive
readnonatomicassign

Specifies whether demo route is active.

◆ locationDetectionAccuracy

- (CLLocationAccuracy) locationDetectionAccuracy
readwritenonatomicassign

GPS location accuracy.

◆ locationServicesAuthorizationStatus

- (CLAuthorizationStatus) locationServicesAuthorizationStatus
readnonatomicassign

The current location services authorization status for the app.

◆ snappingGpsPositionToRoadsEnabled

- (BOOL) snappingGpsPositionToRoadsEnabled
readwritenonatomicassign

If set to YES, Navmii SDK will try to find the most suitable road for each GPS location and display the GPS location marker on it. If set to NO, GPS location marker will show real GPS location depending on whether the GPS extrapolation is enabled. Default value is YES;

◆ trackRecorder

- (NMTrackRecorder*) trackRecorder
readnonatomicstrong

Instance of a track recorder. Returns nil if SDK is not initialized.