kopia lustrzana https://github.com/magicbug/Cloudlog
[QRA] Check length of the gridsquare isn't greater than 6 chars
This fixes #934 as Cloudlog bearings only works for squares that are less than 6 chars.pull/976/head
rodzic
e3ba7411aa
commit
4c9ba52a9b
|
@ -23,12 +23,14 @@ class Qra {
|
|||
|
||||
// calculate the bearing between two squares
|
||||
function bearing($tx, $rx, $unit = 'M') {
|
||||
$my = qra2latlong($tx);
|
||||
$stn = qra2latlong($rx);
|
||||
if(strlen($tx) <= 6 && strlen($rx) <= 6) {
|
||||
$my = qra2latlong($tx);
|
||||
$stn = qra2latlong($rx);
|
||||
|
||||
$bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit);
|
||||
|
||||
return $bearing;
|
||||
$bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit);
|
||||
|
||||
return $bearing;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue