Fixes for API and live map
This commit is contained in:
@@ -34,8 +34,14 @@ class GeoJson
|
||||
*/
|
||||
public function addPoint($lat, $lon, array $attrs)
|
||||
{
|
||||
$point = [$lon, $lat];
|
||||
$this->line_coords[] = [$lon, $lat];
|
||||
$this->point_coords[] = new Feature(new Point([$lon, $lat]), $attrs);
|
||||
|
||||
if(array_key_exists('alt', $attrs)) {
|
||||
$point[] = $attrs['alt'];
|
||||
}
|
||||
|
||||
$this->point_coords[] = new Feature(new Point($point), $attrs);
|
||||
++$this->counter;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ use PhpUnitsOfMeasure\Exception\NonStringUnitName;
|
||||
* @property Carbon created_at
|
||||
* @property Carbon updated_at
|
||||
* @property bool state
|
||||
* @property Acars position
|
||||
* @package App\Models
|
||||
*/
|
||||
class Pirep extends Model
|
||||
@@ -177,6 +178,19 @@ class Pirep extends Model
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the block on time
|
||||
* @return Carbon
|
||||
*/
|
||||
public function getSubmittedAtAttribute()
|
||||
{
|
||||
if (array_key_exists('submitted_at', $this->attributes)) {
|
||||
return new Carbon($this->attributes['submitted_at']);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new Length unit so conversions can be made
|
||||
* @return int|Distance
|
||||
|
||||
Reference in New Issue
Block a user