C# SDK

◆ SetRoute() [2/3]

static int SetRoute ( out SError  Error,
string  strItineraryName,
Int32  Flags,
bool  bClosedAsDelivery,
bool  bShowApplication,
Int32  MaxTime 
)
inlinestatic

The function computes route based on taken itinerary. If Drive has valid GPS signal it starts navigation.

Parameters
ErrorAdditional error information returned from Drive.
strItineraryNameName of the itinerary which will be used to compute route.
MaxTimeMaximum time (in milliseconds) function can take. If MaxTime=0 function execution is not time limited.
bShowApplicationFlag determining whether Drive should be brought to foreground automatically.
true - Drive will be brought to foreground.
false - Drive will stay in background.
FlagsParameter Flags determines route computing properties.
Possible values are enumerated in: NavigationParams.
bClosedAsDeliveryParameter determining whether the waypoint is in restricted area or not
true - if a waypoint is in delivery area, the route will be calculated
false - if a waypoint is in delivery area, it will be considered restricted area
Returns
1 if successful, other value otherwise.
Remarks
If Drive does not have valid GPS signal first waypoit in itinerary must be marked as START.

Parameter Flags determines route computing properties.
For example it is possible to ask user to avoid toll roads or (later) notify user that not all toll roads can be avoided.

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

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

Itinerary used to compute route must contain item of type "finish". If you do not have valid GPS position itinerary must contain also item of type "start".

When in navigation the events from ApplicationEvents enumeration occur.

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.
  • -7 - Itinerary is empty
  • -8 - Itinerary has invalid format (from version 15j)
  • -9 - One or more waypoints were not found (from version 15j)
  • -10 - Itinerary was not found (from version 15j)

References SError.SizeOf().