Add ACARS live time/coords/default zoom into admin settings
This commit is contained in:
@@ -25,13 +25,20 @@ class LiveMap extends Widget
|
||||
$geoSvc = app(GeoService::class);
|
||||
$acarsRepo = app(AcarsRepository::class);
|
||||
|
||||
$pireps = $acarsRepo->getPositions();
|
||||
$pireps = $acarsRepo->getPositions(setting('acars.live_time', 0));
|
||||
$positions = $geoSvc->getFeatureForLiveFlights($pireps);
|
||||
|
||||
$center_coords = setting('acars.center_coords', '0,0');
|
||||
$center_coords = array_map(function($c) {
|
||||
return (float) trim($c);
|
||||
}, explode(',', $center_coords));
|
||||
|
||||
return view('widgets.live_map', [
|
||||
'config' => $this->config,
|
||||
'pireps' => $pireps,
|
||||
'positions' => $positions,
|
||||
'config' => $this->config,
|
||||
'pireps' => $pireps,
|
||||
'positions' => $positions,
|
||||
'center' => $center_coords,
|
||||
'zoom' => setting('acars.default_zoom', 5),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user