Формат координат на странице точки
This commit is contained in:
parent
560f09c888
commit
d5474fd524
|
|
@ -4,12 +4,11 @@ class Coord
|
|||
{
|
||||
static function dergeeToMinute($input)
|
||||
{
|
||||
if ($input < 0)
|
||||
$input *= -1;
|
||||
$input = abs($input);
|
||||
|
||||
$degree = floor($input);
|
||||
$minute = 60 * ($input - $degree);
|
||||
|
||||
return $degree.'°'.$minute.'\'';
|
||||
return $degree.'°'.substr($minute,0,6).'\'';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
<div class="coords-container">
|
||||
Координаты:
|
||||
<nobr>
|
||||
<?= $point->lat > 0 ? 'N' : 'S' ?><?= $point->lat > 0 ? $point->lat : (-1 * $point->lat) ?>°
|
||||
<?= $point->lng > 0 ? 'E' : 'W' ?><?= $point->lng > 0 ? $point->lng : (-1 * $point->lng) ?>°
|
||||
<?= $point->lat > 0 ? 'N' : 'S' ?><?= number_format(abs($point->lat),5,'.','') ?>°
|
||||
<?= $point->lng > 0 ? 'E' : 'W' ?><?= number_format(abs($point->lng),5,'.','') ?>°
|
||||
</nobr>
|
||||
/
|
||||
<nobr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue