Файл: maps.php
Строк: 10
<?php
if(empty($_GET['x'])) { $x = 0; } else { $x = floatval($_GET['x']); }
if(empty($_GET['y'])) { $y = 0; } else { $y = floatval($_GET['y']); }
if(empty($_GET['z']) or intval($_GET['z'])>17 or intval($_GET['z'])<0) { $z = 0; } else { $z = intval($_GET['z']); }
switch ($z)
{
case 0:
$direct = 0;
break;
case 1:
$direct = 15;
break;
case 2:
$direct = 10;
break;
case 3:
break;
case 4:
$direct = 4;
break;
case 5:
$direct = 2;
break;
case 6:
$direct = 1;
break;
case 7:
$direct = 0.7;
break;
case 8:
$direct = 0.2;
break;
case 9:
$direct = 0.1;
break;
case 10:
$direct = 0.05;
break;
case 11:
$direct = 0.01;
break;
case 12:
$direct = 0.009;
break;
case 13:
$direct = 0.003;
break;
case 14:
$direct = 0.002;
break;
case 15:
$direct = 0.001;
break;
case 16:
$direct = 0.0007;
break;
case 17:
$direct = 0.0003;
break;
}
echo '<img style="border: 1px solid gray;" src="http://maps.googleapis.com/maps/api/staticmap?center='.$y.','.$x.'&zoom='.$z.'&maptype=hybrid&size=140x140&sensor=false" width="150px" height="150px" />';
echo '<hr/>
<a href="maps.php?x='.($x-$direct).'&y='.$y.'&z='.$z.'"> < </a> |
<a href="maps.php?x='.($x+$direct).'&y='.$y.'&z='.$z.'"> > </a> |
<a href="maps.php?y='.($y-$direct).'&x='.$x.'&z='.$z.'">'.$lang['down'].'</a> |
<a href="maps.php?y='.($y+$direct).'&x='.$x.'&z='.$z.'">'.$lang['up'].'</a>';
if($_GET['z']<17)
{
echo '<a href="maps.php?y='.$y.'&x='.$x.'&z='.($z+1).'">+</a> | ';
}
else
{
echo '+ | ';
}
if($_GET['z']>0)
{
echo '<a href="maps.php?y='.$y.'&x='.$x.'&z='.($z-1).'">-</a>';
}
else
{
echo '-';
}
echo '<hr/><input type="text" value="http://'.$_SERVER['HTTP_HOST'].'/maps.php?y='.$y.'&x='.$x.'&z='.$z.'" /> ';
?>