C# SDK

◆ AddEntryToItinerary()

static int AddEntryToItinerary ( out SError  Error,
string  strItineraryName,
ref SStopOffPoint  StopOffPoint,
int  nIndex,
Int32  MaxTime 
)
inlinestatic

The function adds new waypoint to taken itinerary.

Parameters
ErrorAdditional error information returned from Drive.
strItineraryNameName of itinerary where new item will be added.
StopOffPointReference to instance of SStopOffPoint class containing informations about waypoint to be added to itinerary.
nIndexIndex of position where new waypoint will be inserted.
MaxTimeMaximum time (in milliseconds) function can take. If MaxTime=0 function execution is not time limited.
Returns
1 if successful, other value otherwise.

If nIndex is lower than 0 or highier than number of items in itinerary the waypoint will be added at the end of list.

It is necessary to set Location, nPointType and Caption members of StopOffPoint (see SStopOffPoint class)..

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.



SError error;
string strItineraryName = "MyItin";
SStopOffPoint stopOffPoint = new SStopOffPoint();
int nIndex = -1;
int MaxTime = 10000;
string strAddress = "SVK,Bratislava,Einsteinova,1";
LONGPOSITION Position;
CApplicationAPI.LocationFromAddress(out error, out Position, strAddress, MaxTime);
stopOffPoint.bSearchAddress = 1;
stopOffPoint.bVisited = 0;
stopOffPoint.SetCaption("MyWaypoint");
stopOffPoint.nPointType = 2;
stopOffPoint.Location.lX = 123456;
stopOffPoint.Location.lY = 543210;
CApplicationAPI.AddEntryToItinerary(out error, strItineraryName, StopOffPoit, nIndex, MaxTime);

This code adds new waypoint to MyItin itinerary.
Waypoint name is set to MyWaypoint and location is [123456, 543210] taken in meters. Type of waypoint is Finish and was not visited yet.
After AddEntryToItinerary execution stopOffPoint.GetAddress function returns waypoint address in "ISO, City, Street, house number" format.

References SStopOffPoint.SizeOf(), and SError.SizeOf().