C++ SDK

◆ StartNavigation() [3/3]

static int CApplicationAPI::StartNavigation ( LpError  lpError,
SLocation lpLocation,
DWORD  dwFlags,
BOOL  bCloseDelivery,
BOOL  bShowApplication,
BOOL  bSearchAddress,
SRouteComputeSettings lpCompSettings,
DWORD  dwMaxTime = DEFAULT_MAX_TIME 
)
static

The function starts navigate to taken location.

Parameters
lpErrorAdditional error information returned from Drive.
lpLocationReference to instance of SWayPoint class which contains informations about target.
bSearchAddressFlag determining whether GetHistoryList searches for address or not.
true - StartNavigation fills address member of each SHistoryRecord with corresponding address.
false - StartNavigation does not search for address.
dwMaxTimeMaximum time (in milliseconds) function can take. If dwMaxTime=0 function execution is not time limited.
dwFlagsParameter Flags determines route computing properties.
It should be value from NavigationParams.
bShowApplicationFlag determining whether Drive should be brought to foreground automatically.
true - Drive will be brought to foreground
false - Drive will stay in background
bCloseDeliveryFlag determining whether the delivery area is restricted or not.
true - if waypoint is in delivery area, the route will be computed
false - if waypoint is in delivery area, it will be considered restricted area
specialsettings used for route computing
Returns
1 if successful, other value otherwise.

To use this function it is necessary to have valid GPS signal and Location must be situated on loaded map. It is necessary to set Location member of Location.

Parameter Flags determines some route computing properties. Possible values are enumerated in NavigationParams enum. For example it is possible notify user that not all toll roads can be avoided.

To join more flags together use logical or operator (|). For more informations see enum.

It is possible to get returned (if address is returned) address by calling function

If waypoint is in restricted area , the function will return lX,lY coordinates of closest reached point in error description (truck attributes enabled) Location.SWayPoint::GetAddress "GetAddress()".

See Coordinates conversion section in TROUBLESHOOTING page.

Possible error codes returned from Drive are:

  • 0 - Function not succeeded.
  • 1 - Function succeeded.
  • 2 - Drive not succeeded.
  • 3 - Function reached timeout.
  • -1 - Navigation not started because address was not found or closest reached point was found.
  • -3 - Navigation not started. Drive is already navigating.
  • -5 - User canceled route computing.
  • -6 - Drive is waiting for valid GPS signal.