Android Java SDK for Sygic 3D
 
Loading...
Searching...
No Matches
ApiLocation Class Reference

Static Public Member Functions

static String getLocationAddressInfo (Position location, int maxTime) throws InvalidLocationException
 Returns address corresponding to given location.
 
static RoadInfo getLocationRoadInfo (Position location, int maxTime) throws InvalidLocationException
 Returns road info corresponding to given location.
 
static Position locationFromAddress (String address, boolean postal, boolean valueMatch, int maxTime) throws GeneralException
 Returns gps location corresponding to a given address.
 
static ArrayList< WayPointlocationFromAddressEx (String address, boolean postal, boolean fuzzySearch, int maxTime) throws GeneralException
 Returns location corresponding to taken address.
 
static boolean searchLocation (String text, OnSearchListener onSearchListener, int maxTime) throws GeneralException
 Returns address candidates through the listener based on the free text string input.
 

Member Function Documentation

◆ getLocationAddressInfo()

static String getLocationAddressInfo ( Position location,
int maxTime ) throws InvalidLocationException
static

Returns address corresponding to given location.

Parameters
locationmodel.Position instance which contains location for which is the address searched.
maxTimeMaximum time (in milliseconds) the function can take. If maxTime=0 function execution is not time limited.
Returns
String instance which contains found address in format: "ISO,city,street,house number".
Exceptions
InvalidLocationExceptionthe invalid location exception

References Api.getInstance(), and Api.getService().

◆ getLocationRoadInfo()

static RoadInfo getLocationRoadInfo ( Position location,
int maxTime ) throws InvalidLocationException
static

Returns road info corresponding to given location.

Parameters
locationmodel.Position instance which contains location for which is the address searched.
maxTimeMaximum time (in milliseconds) the function can take. If maxTime=0 function execution is not time limited.
Returns
model.RoadInfo instance which contains information about the road on that position.
Exceptions
InvalidLocationExceptionthe invalid location exception

References Api.getInstance(), Api.getService(), and RoadInfo.readBundle().

◆ locationFromAddress()

static Position locationFromAddress ( String address,
boolean postal,
boolean valueMatch,
int maxTime ) throws GeneralException
static

Returns gps location corresponding to a given address.

Parameters
addressthe address string in the format "ISO,city,street,house number" or "ISO,zip code,street,house number"
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
valueMatchDetermines whether the result will be the exact match or the best value match (true for fuzzy search of address).
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
model.Position instance represented by GPS coordinates

Notes:
Address parameter house number is optional. If you do not want to fill it write address like this:
"SVK,Bratislava,Einsteinova,"
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.

Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

◆ locationFromAddressEx()

static ArrayList< WayPoint > locationFromAddressEx ( String address,
boolean postal,
boolean fuzzySearch,
int maxTime ) throws GeneralException
static

Returns location corresponding to taken address.

Parameters
addressthe address of the location in format: "ISO,city,street,house number".
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
fuzzySearchDetermines whether the result will be the exact match or the best value match (true for fuzzy search of address).
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
ArrayList of retrieved model.WayPoint items.

Notes:
The function returns location corresponding to taken address. In some cases there can be more cities with the same name in one country or more streets with the some name in one city.
If there are more results corresponding to taken address LocationFromAddressEx stores the results into array of model.WayPoint.
If you want to strictly specify address you can fill optional address parameters of address - extra city and extra street.
Extra city strictly defines region in country where city is situated. It should be set to province or canton of the country.
LocationFromAddressEx function always fills extra city and extra street parts of address so if there are more results you can choose which one is that you meant.
If you do not want to fill optional street parameters make address like this:
"SVK,Bratislava,Einsteinova,1,,"
Optional address paramters are extra city, extra street and house number.
The list of ISO codes can be found at http ://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html .

Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and WayPoint.readBundle().

◆ searchLocation()

static boolean searchLocation ( String text,
OnSearchListener onSearchListener,
int maxTime ) throws GeneralException
static

Returns address candidates through the listener based on the free text string input.

Parameters
textfree text string to identify a searched address, e.g. "aleksanderplatz"
onSearchListenercallback listener serving to return address search candidates through its function onResult
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
true when search operation successfully triggered, false otherwise
Exceptions
GeneralExceptionthe general exception

References CallbacksManager.add(), Api.getInstance(), CallbacksManager.getInstance(), and Api.getService().