Compare commits
1 Commits
bca7680522
...
d290165899
| Author | SHA1 | Date | |
|---|---|---|---|
| d290165899 |
@@ -25,6 +25,8 @@ export async function getOpenskyData() {
|
||||
|
||||
export async function getAdbsExchangeData({ lat, lon, radius }) {
|
||||
const positionSourceMap = ['Unknown', 'Mode-S', 'ADS-B', 'ADS-B', 'ADS-B', 'ADS-B'];
|
||||
const formatNumber = str => str && Number(`${str}`.replace(/[^0-9.-]/, ''));
|
||||
|
||||
const res = await fetch.get(
|
||||
`http://public-api.adsbexchange.com/VirtualRadar/AircraftList.json?lat=${lat}&lng=${lon}&fDstL=0&fDstU=${radius}`
|
||||
);
|
||||
@@ -38,11 +40,11 @@ export async function getAdbsExchangeData({ lat, lon, radius }) {
|
||||
location: rec.Lat && rec.Long ? `${rec.Lat},${rec.Long}` : null,
|
||||
lat: rec.Lat,
|
||||
lon: rec.Long,
|
||||
baro_altitude: rec.Alt,
|
||||
geo_altitude: rec.Galt,
|
||||
baro_altitude: formatNumber(rec.Alt),
|
||||
geo_altitude: formatNumber(rec.GAlt),
|
||||
on_ground: rec.Gnd,
|
||||
velocity: rec.Spd,
|
||||
vertical_rate: rec.Vsi,
|
||||
velocity: formatNumber(rec.Spd),
|
||||
vertical_rate: formatNumber(rec.Vsi),
|
||||
squawk: rec.Sqk,
|
||||
spi: false,
|
||||
position_source: positionSourceMap[rec.Trt],
|
||||
|
||||
Reference in New Issue
Block a user