◆ NavigateToAddress() [1/2]

static int NavigateToAddress ( out SError  Error,
string  Address,
bool  bPostal,
Int32  Flags,
bool  bShowApplication,
Int32  MaxTime 

The function computes route from actual GPS position to taken target and starts navigate to taken address.

ErrorAdditional error information returned from Drive.
AddressSpecifies address of route target. Address must be in "ISO,city/ ZIP, street, house number" format.
bPostalFlag determining whether second address parameter represents city or ZIP code.
true - ZIP code.
false - City.
FlagsParameter 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
MaxTimeMaximum time (milliseconds) function can take. If MaxTime=0 function execution is not time limited.
1 if successful, other value otherwise.

To use this function it is necessary to have valid GPS signal and address must be situated on loaded maps.

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 NavigationParams enum.

Address parameter house number is optional. If you do not want to fill it write address like this:

Second address parameter can represent city name or ZIP code.
The list of ISO codes can be found at http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.

ISO code of United States of America consists of character "U" plus code of state. E.g New York has ISO code UNY. Indian states ISO codes can be found at http://devforum.sygic.com/viewtopic.php?f=15&t=2925&p=3646&hilit=I01&sid=354efb86bb92dc0dcdfcc1bb8d656c20#p3646

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.
  • -3 - Navigation not started. Drive is already navigating.
  • -5 - User canceled route computing.
  • -6 - Drive is waiting for valid GPS signal. This means, you don't have to call this funciton again, it will start to navigat automatically when the signal is acquired.
SError error;
string Address;
int Flags;
bool bShowApplication;
int MaxTime;
Address = "SVK,Bratislava,Agatova,1";
Flags = NavigationParams.NpMessageAvoidTollRoadsUnable;
bShowApplication = true;
bSearchAddress = true;
MaxTime = 10000;
CApplicationAPI.NavigateToAddress(out error, Address, Flags, bShowApplication, MaxTime);

References SError.SizeOf().