Allow for gps data that doesnt include altitude
This commit is contained in:
parent
d25900b800
commit
d9908c043f
@ -31,7 +31,7 @@ class meta extends SubAtom
|
||||
$m = [];
|
||||
preg_match('/^([+-][0-9]{2,6}(?:\.[0-9]+)?)([+-][0-9]{3,7}(?:\.[0-9]+)?)([+-][0-9]+(?:\.[0-9]+)?)?/',$gps,$m);
|
||||
|
||||
return ['lat'=>(float)$m[1],'lon'=>(float)$m[2],'alt'=>(float)$m[3]];
|
||||
return ['lat'=>(float)$m[1],'lon'=>(float)$m[2],'alt'=>isset($m[3]) ? (float)$m[3] : NULL];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user