Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When navigating on the route you can get a NMNavigationInfo instance from NMNavigationService. This object will contain the following information:

  • current road information
  • next road information
  • next direction
  • distance to the next direction in meters
  • speed limit in km/h
  • user's current speed in km/h
  • time to destination point in seconds
  • distance to destination point in meters
  • passed distance in meters
  • country information
  • distance to the next speed camera in meters

To understand how road information is presented in the SDK please refer to ROAD INFO section. Here is an example of code giving you the idea how to retrieve this information:

Code Block
languagecpp
themeEclipse
NMNavigationInfo *navigationInfo = [[NMSdk sharedInstance].navigationService navigationInfo];
NSLog(@"current road name - %@", navigationInfo.currentRoadInfo.name);
NSLog(@"next road name - %@", navigationInfo.nextRoadInfo.name);
NSLog(@"next direction type - %d", (int)navigationInfo.nextDirection.directionType);
NSLog(@"distance to the next direction - %d meters", navigationInfo.distanceToDirection);
NSLog(@"speed limit - %f kmh", navigationInfo.speedLimit);
NSLog(@"current speed - %f kmh", navigationInfo.currentSpeed);
NSLog(@"time to destination - %f seconds", navigationInfo.timeToDestination);
NSLog(@"distance to destination - %f meters", navigationInfo.distanceToDestination);
NSLog(@"passed distance - %f meters", navigationInfo.passedDistance);
NSLog(@"country - %@", navigationInfo.country.name);
NSLog(@"distance to speed camera - %f", navigationInfo.distanceToSpeedCamera);


 A NMRoadInfo instance contains the following information on a road:

  • road name
  • route number
  • road class
  • road usage
  • functional class

Road class is represented as NMRoadClass enum with this set of values:

  • NMRoadClassUndefined
  • NMRoadClassMotorways
  • NMRoadClassPrimaryARoads
  • NMRoadClassSecondaryARoads
  • NMRoadClassBRoads
  • NMRoadClassUnclassified

NMRoadUsage enum is defined with the following values:

  • NMRoadUsageCommon
  • NMRoadUsageRamp
  • NMRoadUsageRoundabout
  • NMRoadUsageFerry

An example of code extracting this information from NMRoadInfo instance can look like this:

Code Block
languagecpp
themeEclipse
NSLog(@"road name - %@", roadInfo.name);
NSLog(@"route number - %@", roadInfo.routeNumber);
NSLog(@"route class - %d", (int)roadInfo.roadClass);
NSLog(@"functional class - %d", (int)roadInfo.functionalClass);