C++ SDK

◆ FindNearbyPoi() [1/2]

static int CApplicationAPI::FindNearbyPoi ( LpError  lpError,
SPoi *&  lpPoi,
DWORD  dwCategoryNumber,
LPCTSTR  lpszCategoryName,
long  lX,
long  lY,
DWORD  dwMaxTime = DEFAULT_MAX_TIME 
)
static

The function finds the nearest POI around given position. The POI may be from the original map POIs or it may be a custom POI.

Parameters
lpErrorAdditional error information returned from Drive.
lpPoiReturned SPoi class containing information about the found POI.
dwCategoryNumberCategory ID. If this value is filled with standard value, original POIs are found. Set to PoiService.USERDEFINE for custom POI. Possible values are enumerated in PoiService enum.
lpszCategoryNameCustom POI category name, if custom POI is searched.
lXX-coordinate of place, where to search.
lYY-coordinate of place, where to search.
dwMaxTimeMaximum time (in milliseconds) function can take. If dwMaxTime=0 function execution is not time limited.
Returns
1 if successful, other value otherwise.

Distance between taken position and POI is computed bee-line.

If dwCategory=PoiService.USERDEFINE it is necessary to define also strCategory. Otherwise category name is obtained from category ID.

X and Y coordinates are geographical longitude and latitude in degrees multiplied by 100000.

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.