UNPKG

aviation-model

Version:

Public methods for querying the information from aviation-pg

2,696 lines (1,047 loc) 40.7 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Documentation Global</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.simplex.css"> <script src="https://use.fontawesome.com/e18d549689.js"></script> </head> <body> <div class="navbar navbar-default navbar-fixed-top "> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">Documentation</a> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse" id="topNavigation"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="global.html#airportsBounds">airportsBounds</a></li><li><a href="global.html#getAirlineCities">getAirlineCities</a></li><li><a href="global.html#getAirlineData">getAirlineData</a></li><li><a href="global.html#getAirportData">getAirportData</a></li><li><a href="global.html#getAirportJson">getAirportJson</a></li><li><a href="global.html#getCity">getCity</a></li><li><a href="global.html#getDestinations">getDestinations</a></li><li><a href="global.html#queryData">queryData</a></li> </ul> </li> </ul> <div class="col-sm-3 col-md-3"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> <div class="input-group-btn"> <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> </div> <div id="code-links"> <a href="https://github.com/cristobal-io/aviation-model" class="code-logo-link"><i class="fa fa-github fa-2x" aria-hidden="true"></i></a><a href="https://www.npmjs.com/package/aviation-model" class="code-logo-link"><a href="https://www.npmjs.com/package/aviation-model" class="code-logo-link"><svg class="code-svg" viewBox="0 0 18 7"><path fill="red" d="M0,0v6h5v1h4v-1h9v-6"/><path fill="#FFF" d="M1,1v4h2v-3h1v3h1v-4h1v5h2v-4h1v2h-1v1h2v-4h1v4h2v-3h1v3h1v-3h1v3h1v-4"/></svg></a> </div> </div> </div> </div> <div class="container" id="toc-content"> <div class="row"> <div class="col-md-8"> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <dl> <hr> <dt> <h4 class="name" id="airportsBounds"><span class="type-signature"></span>airportsBounds(options, callback)</h4> </dt> <dd> <div class="description"> with this function we retrieve all the airports located inside a bound box. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">pass all the values to use on the query. <h6 class="method-params-label method-subparams-label">Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>latitude1</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">latitude of the first point</td> </tr> <tr> <td class="name"><code>longitude1</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">longitude of the first point</td> </tr> <tr> <td class="name"><code>latitude2</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">latitude of the first point</td> </tr> <tr> <td class="name"><code>longitude2</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">longitude of the first point</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> returns an array with the data requested. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.airportsBounds({ latitude1: 38, longitude1: -123, latitude2: 37, longitude2: -122 }, function (err, boxAirports) { if (err) {throw err;} console.log(boxAirports); }); // returns the following array [ { airport_id: &#x27;Buchanan_Field_Airport&#x27;, latitude: &#x27;37°59′23″N&#x27;, longitude: &#x27;122°03′25″W&#x27;, name: &#x27;Buchanan International\nConcord Army Air Base&#x27;, nickname: &#x27;CCR&#x27;, iata: &#x27;CCR&#x27;, icao: &#x27;KCCR&#x27;, dd_latitude: 37.98972222222222, dd_longitude: -122.05694444444444 }, { airport_id: &#x27;Half_Moon_Bay_Airport&#x27;, latitude: &#x27;37°30′48″N&#x27;, longitude: &#x27;122°30′04″W&#x27;, name: &#x27;Eddie Andreini Sr. Airfield\nHalf Moon Bay Airport&#x27;, nickname: &#x27;HAF&#x27;, iata: &#x27;HAF&#x27;, icao: &#x27;KHAF&#x27;, dd_latitude: 37.513333333333335, dd_longitude: -122.50111111111111 }, { airport_id: &#x27;Hayward_Executive_Airport&#x27;, latitude: &#x27;37°39′32″N&#x27;, longitude: &#x27;122°07′18″W&#x27;, name: &#x27;Hayward Executive Airport&#x27;, nickname: &#x27;(former Hayward Army Air Field)&#x27;, iata: &#x27;HWD&#x27;, icao: &#x27;KHWD&#x27;, dd_latitude: 37.65888888888889, dd_longitude: -122.12166666666666 }, { airport_id: &#x27;Moffett_Federal_Airfield&#x27;, latitude: &#x27;37°24′54″N&#x27;, longitude: &#x27;122°02′54″W&#x27;, name: &#x27;Moffett Federal Airfield&#x27;, nickname: &#x27;NUQ&#x27;, iata: &#x27;NUQ&#x27;, icao: &#x27;KNUQ&#x27;, dd_latitude: 37.415, dd_longitude: -122.04833333333333 }, { airport_id: &#x27;Oakland_International_Airport&#x27;, latitude: &#x27;37°43′17″N&#x27;, longitude: &#x27;122°13′15″W&#x27;, name: &#x27;Oakland International Airport&#x27;, nickname: &#x27;OAK&#x27;, iata: &#x27;OAK&#x27;, icao: &#x27;KOAK&#x27;, dd_latitude: 37.72138888888889, dd_longitude: -122.22083333333333 }, { airport_id: &#x27;Palo_Alto_Airport&#x27;, latitude: &#x27;37°27′40″N&#x27;, longitude: &#x27;122°06′54″W&#x27;, name: &#x27;Palo Alto Airport&#x27;, nickname: &#x27;PAO&#x27;, iata: &#x27;PAO&#x27;, icao: &#x27;KPAO&#x27;, dd_latitude: 37.461111111111116, dd_longitude: -122.115 }, { airport_id: &#x27;San_Francisco_International_Airport&#x27;, latitude: &#x27;37°37′08″N&#x27;, longitude: &#x27;122°22′30″W&#x27;, name: &#x27;San Francisco International Airport&#x27;, nickname: &#x27;SFO&#x27;, iata: &#x27;SFO&#x27;, icao: &#x27;KSFO&#x27;, dd_latitude: 37.61888888888889, dd_longitude: -122.375 }, { airport_id: &#x27;San_Carlos_Airport_(California)&#x27;, latitude: &#x27;37°30′43″N&#x27;, longitude: &#x27;122°14′58″W&#x27;, name: &#x27;San Carlos Airport&#x27;, nickname: &#x27;SQL&#x27;, iata: &#x27;SQL&#x27;, icao: &#x27;KSQL&#x27;, dd_latitude: 37.511944444444445, dd_longitude: -122.24944444444445 } ]</pre> </dd> <hr> <dt> <h4 class="name" id="getAirlineCities"><span class="type-signature"></span>getAirlineCities(airline, callback)</h4> </dt> <dd> <div class="description"> This method returns the cities of all the airports that an airline is flying to. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>airline</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">airline_id value we want to search, we can use wildcard %</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> All the cities. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getAirlineCities(&quot;American_Airlines&quot;, function(err, cities) { if (err) {throw err; } console.log(cities); }); // this returns the following array: [ &#x27;St._John%27s,_Antigua_and_Barbuda&#x27;, &#x27;Buenos_Aires&#x27;, &#x27;Oranjestad,_Aruba&#x27;, &#x27;Sydney&#x27;, &#x27;Nassau,_Bahamas&#x27;, &#x27;Bridgetown,_Barbados&#x27;, &#x27;Belize_City&#x27;, &#x27;Brussels&#x27;, &#x27;Hamilton,_Bermuda&#x27;, &#x27;La_Paz&#x27;, // this continues to complete all the cities. ]</pre> </dd> <hr> <dt> <h4 class="name" id="getAirlineData"><span class="type-signature"></span>getAirlineData(options, callback)</h4> </dt> <dd> <div class="description"> Gets data for a single airline </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Contains all the options. <h6 class="method-params-label method-subparams-label">Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">name | logo_url | iata | icao | callsign | website</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the value according to the type specified.</td> </tr> <tr> <td class="name"><code>method</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">name | logo_url | iata | icao | callsign | website Optional we can leave the method empty to get all the information from the airline.</td> </tr> <tr> <td class="name"><code>verbose</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">specify if you want to have logging.</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> returns the information requested. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getAirlineData({ value: &quot;American_Airlines&quot;, type: &quot;airline_id&quot;, method: &quot;website&quot; }, function (err, data) { if (err) {throw err;} console.log(&quot;Web: &quot;, data); }); // This will print out: // Web: http://www.aa.com</pre> </dd> <hr> <dt> <h4 class="name" id="getAirportData"><span class="type-signature"></span>getAirportData(options, callback)</h4> </dt> <dd> <div class="description"> Gets data for a single airport. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"> <h6 class="method-params-label method-subparams-label">Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">airport_id | name | latitude | longitude | nickname | iata | icao</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">the value according to the type specified.</td> </tr> <tr> <td class="name"><code>method</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">airport_id | name | location | latitude | longitude | nickname | iata | icao (if we don't specify the method, the whole airport data will be served).</td> </tr> <tr> <td class="name"><code>verbose</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> </td> <td class="description last">specify if you want to have logging.</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> requested information. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getAirportData({ value: &quot;SFO&quot;, type: &quot;iata&quot;, method: &quot;latitude&quot; }, function (err, data) { if (err) {throw err;} console.log(data); }); // returns: // &quot;37°37′08″N</pre> </dd> <hr> <dt> <h4 class="name" id="getAirportJson"><span class="type-signature"></span>getAirportJson(searchOptions, callback)</h4> </dt> <dd> <div class="description"> This function retrieves all the information of an airport in a JSON format. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>searchOptions</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">key and value (string) to find.</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> JSON data of the airport requested. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getAirportJson({ airport_id: &quot;San_Francisco_International_Airport&quot; }, function (err, airport) { if (err) { throw err; } console.log(&quot;Airport:&quot;, airport); }); // this logs the following JSON object. Airport: { location: &#x27;37°37′08″N 122°22′30″W&#x27;, airport_id: &#x27;San_Francisco_International_Airport&#x27;, latitude: &#x27;37°37′08″N&#x27;, longitude: &#x27;122°22′30″W&#x27;, name: &#x27;San Francisco International Airport&#x27;, nickname: &#x27;SFO&#x27;, iata: &#x27;SFO&#x27;, icao: &#x27;KSFO&#x27; }</pre> </dd> <hr> <dt> <h4 class="name" id="getCity"><span class="type-signature"></span>getCity(airport, callback)</h4> </dt> <dd> <div class="description"> Finds the city for the specific airport </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>airport</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Exact airport_id</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> The name of the city where the airport is located. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getCity(&quot;San_Francisco_International_Airport&quot;, function(err, city) { if (err) {throw err;} console.log(&quot;city: &quot;, city); }); // This will return the following: // city: San_Francisco</pre> </dd> <hr> <dt> <h4 class="name" id="getDestinations"><span class="type-signature"></span>getDestinations(airline, callback)</h4> </dt> <dd> <div class="description"> It performs a search at the db and returns all the destinations of the airline or airlines that match the string. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>airline</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the airline_id we want to look for, use wildcard %</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> array composed with objects that include airline_id and airport_id </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="sunlight-highlight-javascript">aviationModel.getDestinations(&quot;American_Airlines&quot;, function (err, destinations) { if (err) {throw err;} console.log(JSON.stringify(destinations, null, 2)); }); // this will return the following array: [ { &quot;airline_id&quot;: &quot;American_Airlines&quot;, &quot;airport_id&quot;: &quot;V._C._Bird_International_Airport&quot; }, { &quot;airline_id&quot;: &quot;American_Airlines&quot;, &quot;airport_id&quot;: &quot;Ministro_Pistarini_International_Airport&quot; }, { &quot;airline_id&quot;: &quot;American_Airlines&quot;, &quot;airport_id&quot;: &quot;Queen_Beatrix_International_Airport&quot; }, { &quot;airline_id&quot;: &quot;American_Airlines&quot;, &quot;airport_id&quot;: &quot;Sydney_Airport&quot; }, { &quot;airline_id&quot;: &quot;American_Airlines&quot;, &quot;airport_id&quot;: &quot;Lynden_Pindling_International_Airport&quot; }, // continue until complete the total destinations... ]</pre> </dd> <hr> <dt> <h4 class="name" id="queryData"><span class="type-signature"></span>queryData(options, query, callback)</h4> </dt> <dd> <div class="description"> formula to use all the queries stored at ./sql/queries/ </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">pass all the values to use on the query. <h6 class="method-params-label method-subparams-label">Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>searchString</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">text to use on the query.</td> </tr> <tr> <td class="name"><code>distance</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">distance in meters to look for formulas using radius.</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>query</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">specified the name of the query you are going to use. <h6 class="method-params-label method-subparams-label">Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>airlines</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">airline_id of the airline (wildcard %)</td> </tr> <tr> <td class="name"><code>airlineDestinations</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">id of the airline (1 airline) (wildcard %) will return the airports with complete data.</td> </tr> <tr> <td class="name"><code>citiesByAirline</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Name of the airline (wildcard %)</td> </tr> <tr> <td class="name"><code>airportData</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">This query accepts the name (wildcard %)</td> </tr> <tr> <td class="name"><code>airportRunways</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Name of the airport (wildcard %)</td> </tr> <tr> <td class="name"><code>radiusAirports</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">airport_id (wildcard %) and the distance of the radius in meters.</td> </tr> <tr> <td class="name"><code>airlinesByAirport</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">airport_id (wildcard %)</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> returns an array with the data requested. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Examples</h5> <pre class="sunlight-highlight-javascript">aviationModel.queryData({ searchString: &quot;San_Francisco%&quot;, distance: 100 * 1000 }, &quot;radiusAirports&quot;, function (err, radiusAirports) { if (err) {throw err;} console.log(radiusAirports); }); // This will return the following array: [ { airport_id: &#x27;San_Francisco_International_Airport&#x27;, name: &#x27;San Francisco International Airport&#x27;, latitude: &#x27;37°37′08″N&#x27;, longitude: &#x27;122°22′30″W&#x27;, distance: 0 }, { airport_id: &#x27;Half_Moon_Bay_Airport&#x27;, name: &#x27;Eddie Andreini Sr. Airfield\nHalf Moon Bay Airport&#x27;, latitude: &#x27;37°30′48″N&#x27;, longitude: &#x27;122°30′04″W&#x27;, distance: 16183.33 }, { airport_id: &#x27;San_Carlos_Airport_(California)&#x27;, name: &#x27;San Carlos Airport&#x27;, latitude: &#x27;37°30′43″N&#x27;, longitude: &#x27;122°14′58″W&#x27;, distance: 16262.58 }, { airport_id: &#x27;Oakland_International_Airport&#x27;, name: &#x27;Oakland International Airport&#x27;, latitude: &#x27;37°43′17″N&#x27;, longitude: &#x27;122°13′15″W&#x27;, distance: 17740.59 }, { airport_id: &#x27;Hayward_Executive_Airport&#x27;, name: &#x27;Hayward Executive Airport&#x27;, latitude: &#x27;37°39′32″N&#x27;, longitude: &#x27;122°07′18″W&#x27;, distance: 22771.33 }, // this continues to complete all the airports in the radius. ]</pre> <pre class="sunlight-highlight-javascript">aviationModel.queryData({ searchString: &quot;Vueling%&quot; }, &quot;airlineDestinations&quot; , function (err, destinations) { if (err) {throw err;} console.log(destinations); }); // This will return the following array: [ { &quot;airline_id&quot;: &quot;Vueling&quot;, &quot;airport_id&quot;: &quot;Pulkovo_Airport&quot;, &quot;latitude&quot;: &quot;59°48′01″N&quot;, &quot;longitude&quot;: &quot;30°15′45″E&quot;, &quot;name&quot;: &quot;Pulkovo Airport&quot;, &quot;nickname&quot;: &quot;Аэропорт Пулково&quot;, &quot;iata&quot;: &quot;LED&quot;, &quot;icao&quot;: &quot;ULLI&quot;, &quot;dd_latitude&quot;: 59.80027777777777, &quot;dd_longitude&quot;: 30.2625 }, { &quot;airline_id&quot;: &quot;Vueling&quot;, &quot;airport_id&quot;: &quot;Belgrade_Nikola_Tesla_Airport&quot;, &quot;latitude&quot;: &quot;44°49′10″N&quot;, &quot;longitude&quot;: &quot;20°18′25″E&quot;, &quot;name&quot;: &quot;Belgrade Nikola Tesla AirportAerodrom Nikola Tesla a.d.&quot;, &quot;nickname&quot;: &quot;Аеродром Никола Тесла Београд&quot;, &quot;iata&quot;: &quot;BEG&quot;, &quot;icao&quot;: &quot;LYBE&quot;, &quot;dd_latitude&quot;: 44.81944444444445, &quot;dd_longitude&quot;: 20.306944444444444 }, { &quot;airline_id&quot;: &quot;Vueling&quot;, &quot;airport_id&quot;: &quot;Houari_Boumediene_Airport&quot;, &quot;latitude&quot;: &quot;36°41′27.65″N&quot;, &quot;longitude&quot;: &quot;003°12′55.47″E&quot;, &quot;name&quot;: &quot;Houari Boumediene AirportHouari Boumediene AirportHouari Boumediene Airport&quot;, &quot;nickname&quot;: &quot;مطار هواري بومدين الدولي&quot;, &quot;iata&quot;: &quot;ALG&quot;, &quot;icao&quot;: &quot;DAAG&quot;, &quot;dd_latitude&quot;: 36.69101388888888, &quot;dd_longitude&quot;: 3.2154083333333334 }, // this continues to complete all the destinations. ]</pre> </dd> </dl> </article> </section> </div> </div> <div class="clearfix"></div> <div class="col-md-3"> <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div> </div> </div> </div> <div class="modal fade" id="searchResults"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Search results</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <footer> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on 2016-11-03T09:51:47+01:00 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. </span> </footer> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/toc.js"></script> <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); lang = langClassMatch ? langClassMatch[1] : "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : false, showMenu : true, enableDoclinks : true } ); $.catchAnchorLinks( { navbarOffset: 10 } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { var id = $( heading ).attr( "id" ); return id && id.replace(/\~/g, '-inner-').replace(/\./g, '-static-') || ( prefix + i ); }, selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", showAndHide : false, smoothScrolling: true } ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); $( "table" ).each( function () { var $this = $( this ); $this.addClass('table'); } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> <script type="text/javascript"> $(document).ready(function() { SearcherDisplay.init(); }); </script> </body> </html>