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