Skip to content

Instantly share code, notes, and snippets.

@joshuaziering
Created January 10, 2022 22:49
Show Gist options
  • Save joshuaziering/1c6c968c7061c5ad903ee2935238f57b to your computer and use it in GitHub Desktop.
Save joshuaziering/1c6c968c7061c5ad903ee2935238f57b to your computer and use it in GitHub Desktop.
function Airspace(lat, long) {
var url = "https://air.aloft.ai/airspace-api/airspace";
var key = "YOUR-KEY-GOES-HERE";
var payload = 'geometry={"type":"Point","coordinates":['+long+','+lat+']}';
var options = {
'method' : 'post',
'payload' : payload,
'headers': {'Authorization': 'Bearer '+ key}
};
var response = UrlFetchApp.fetch(url, options);
var responsejson = response.getContentText();
var response = JSON.parse(responsejson);
return response.color.name;
}
function B4UFly(lat, long)
{
return 'https://b4ufly.aloft.ai/?lat='+lat+'&long='+long;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment