show dates/times in user's timezone

This commit is contained in:
Nabeel Shahzad
2017-12-23 11:58:17 -06:00
parent eb6e624a4d
commit 3b8621371a
11 changed files with 110 additions and 22 deletions

View File

@@ -178,13 +178,26 @@ class GeoService extends BaseService
* @param Pirep $pirep
* @return array
*/
public function pirepGeoJson(Pirep $pirep)
public function pirepGeoJson($pirep)
{
$coords = [];
$coords[] = [$pirep->dpt_airport->lon, $pirep->dpt_airport->lat];
// TODO: Add markers for the start/end airports
// TODO: Read from the ACARS data table
// TODO: Check if there's data in the ACARS table
if (!empty($pirep->route)) {
$route_coords = $this->getCoordsFromRoute(
$pirep->dpt_airport->icao,
$pirep->arr_airport->icao,
[$pirep->dpt_airport->lat, $pirep->dpt_airport->lon],
$pirep->route);
// lat, lon needs to be reversed for GeoJSON
foreach ($route_coords as $rc) {
$coords[] = [$rc[1], $rc[0]];
}
}
$coords[] = [$pirep->arr_airport->lon, $pirep->arr_airport->lat];