예제 #1
0
파일: geo.php 프로젝트: Tjorriemorrie/app
 function data_to_real(&$x, &$y)
 {
     $x = coordinate_to_number(coordinate_take_apart($x));
     $y = coordinate_to_number(coordinate_take_apart($y));
     $z = $x;
     $x = $y;
     $y = $z;
     # Switching y/x to x/y
     $y = 90 * 3600 - $y;
     # displaying from north to south
     # Recording min and max for viewbox
     $this->min_x = min($this->min_x, $x);
     $this->min_y = min($this->min_y, $y);
     $this->max_x = max($this->max_x, $x);
     $this->max_y = max($this->max_y, $y);
 }
예제 #2
0
if (count($c2) > 0) {
    array_pop($c2);
}
$c2 = implode(";", $c2);
$coords = implode(";", $coords);
print "\n<a href=\"" . htmlspecialchars(make_link($coords)) . "&\">" . "<img src=\"" . htmlspecialchars($image) . "\" ismap/></a>\n";
print "<br /><a href=\"" . htmlspecialchars(make_link($c2)) . "\">Remove last coordinates</a>";
print " | <a href=\"" . htmlspecialchars(make_link(array())) . "\">Reset</a>";
# Conversion form
if (isset($_POST['convert'])) {
    $p1 = explode(",", $_POST['p1']);
    $p2 = explode(",", $_POST['p2']);
    $np1 = explode(",", $_POST['np1']);
    $np2 = explode(",", $_POST['np2']);
    $np1 = array(coordinate_to_number($np1[0]), coordinate_to_number($np1[1]));
    $np2 = array(coordinate_to_number($np2[0]), coordinate_to_number($np2[1]));
    $cx = coord_conversion_params($np1[1], $np2[1], $p1[0], $p2[0]);
    $cy = coord_conversion_params($np1[0], $np2[0], $p1[1], $p2[1]);
    $t = $_POST['ctext'];
    $coords = "";
    $t = explode(" ", $t);
    foreach ($t as $s) {
        $s = explode(",", trim($s));
        if (count($s) == 2) {
            $np = point_to_coords($s, $cx, $cy);
            $coords[] = coordinate_write($np[1]) . "," . coordinate_write($np[0]);
        }
    }
    $coords = implode(" ", $coords);
    # For output
    $p1 = htmlspecialchars($_POST['p1']);