XPLM_API XPLMNavRef XPLMFindNavAid( const char * inNameFragment, /* Can be NULL */ const char * inIDFragment, /* Can be NULL */ float * inLat, /* Can be NULL */ float * inLon, /* Can be NULL */ int * inFrequency, /* Can be NULL */ XPLMNavType inType);
This routine provides a number of searching capabilities for the nav database. XPLMFindNavAid will search through every nav aid whose type is within inType (multiple types may be added together) and return any nav-aids found based on the following rules:
If inLat and inLon are not NULL, the navaid nearest to that lat/lon will be returned, otherwise the last navaid found will be returned.
If inFrequency is not NULL, then any navaids considered must match this frequency. Note that this will screen out radio beacons that do not have frequency data published (like inner markers) but not fixes and airports.
If inNameFragment is not NULL, only navaids that contain the fragment in their name will be returned.
If inIDFragment is not NULL, only navaids that contain the fragment in their IDs will be returned.
This routine provides a simple way to do a number of useful searches:
Find the nearest navaid on this frequency. Find the nearest airport. Find the VOR whose ID is "KBOS". Find the nearest airport whose name contains "Chicago".
XPLMFindNavAid only returns the first navaid in the database that matches the query. More matching navaids can only be found by iterating through the database and comparing the values of the returned navaids "manually".
XPLMGetNextNavAid returns the next navaid in the database, irrespective of the parameters given to a previous XPLMFindNavAid.