Only calculate Lat/Lon if QRA loc has even number of chars
这个提交包含在:
父节点
c1b0d49ae7
当前提交
f77d60436d
共有 1 个文件被更改,包括 19 次插入 和 15 次删除
|
|
@ -119,6 +119,7 @@ $var_dist = "";
|
||||||
function qra2latlong($strQRA)
|
function qra2latlong($strQRA)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
if (strlen($strQRA) %2 == 0) {
|
||||||
$strQRA = strtoupper($strQRA);
|
$strQRA = strtoupper($strQRA);
|
||||||
if (strlen($strQRA) == 4) $strQRA .= "MM";
|
if (strlen($strQRA) == 4) $strQRA .= "MM";
|
||||||
if (!preg_match('/^[A-Z]{2}[0-9]{2}[A-Z]{2}$/',$strQRA)) return false;
|
if (!preg_match('/^[A-Z]{2}[0-9]{2}[A-Z]{2}$/',$strQRA)) return false;
|
||||||
|
|
@ -133,6 +134,9 @@ function qra2latlong($strQRA)
|
||||||
$nLat = ($b*10) + $d + (($f+0.5)/24) - 90;
|
$nLat = ($b*10) + $d + (($f+0.5)/24) - 90;
|
||||||
$arLatLong = array($nLat,$nLong);
|
$arLatLong = array($nLat,$nLong);
|
||||||
return($arLatLong);
|
return($arLatLong);
|
||||||
|
} else {
|
||||||
|
return array(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* End of file Qra.php */
|
/* End of file Qra.php */
|
||||||
正在加载…
在新工单中引用