@@ -231,11 +231,23 @@ class GeoService extends Service
|
||||
]);
|
||||
}*/
|
||||
|
||||
return [
|
||||
'position' => [
|
||||
// If there is a position update from ACARS, show where it is
|
||||
// Otherwise, just assume it's at the arrival airport currently
|
||||
if ($pirep->position) {
|
||||
$position = [
|
||||
'lat' => $pirep->position->lat,
|
||||
'lon' => $pirep->position->lon,
|
||||
],
|
||||
];
|
||||
} else {
|
||||
// if arrived, show it being at the arrival airport
|
||||
$position = [
|
||||
'lat' => $pirep->arr_airport->lat,
|
||||
'lon' => $pirep->arr_airport->lon,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'position' => $position,
|
||||
'line' => $route->getLine(),
|
||||
'points' => $route->getPoints(),
|
||||
'airports' => [
|
||||
|
||||
Reference in New Issue
Block a user