Ejemplo n.º 1
0
            list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
        } else {
            $dotname = $cssdots[$defaultdot];
            list($dotname, , , ) = split(":", $dotname);
            $dotname = clean_param($dotname, PARAM_FILE);
            list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
        }
        // magical formula for placing the css dot
        $x = $x - floor($dotwidth / 2);
        $y = $y - floor($dotheight / 2);
        $extracss = "<style>\n#dotDiv { padding-left:{$x}; padding-top:{$y}; }\n</style>";
        $display = "<div id=\"dotDiv\"><img width=\"{$dotwidth}\" height=\"{$dotheight}\" src=\"{$thedot}\">";
    }
} else {
    // gd mode
    list($width, $height) = getimagecoords($earthimages, $earthimage) or die("Unable to find width/height for image {$earthimage} in config file");
    $extracss = "";
    $display = "<img src=\"plotimage.php?lat={$values['lat']}&amp;lon={$values['lon']}\" width=\"{$width}\" height=\"{$height}\" alt=\"\" />";
}
# START HTML
print '

<html><head><title>' . t("Plotting") . ' ' . $values["address"] . '</title>
' . $extracss . '

<!-- your head tags here -->
<link rel="Stylesheet" href="ip-atlas.css">
</head><body bgcolor="#FFFFFF">


<a name="map"></a>
Ejemplo n.º 2
0
$lat = $form_vars['lat'];
$lon = $form_vars['lon'];
if (isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) {
    list($setshape, $setcolor, $setsize, $earthimage, , ) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
} else {
    $setshape = "Diamond";
    $setcolor = "red";
    $setsize = "3";
    $earthimage = $earthimages[$defaultimage];
    list($earthimage, , , ) = split(":", $earthimage);
}
$earthimage = isvalidimage($earthimage, $earthimages, $defaultimage);
if (strstr($earthimage, ":")) {
    list($earthimage, , , ) = split(":", $earthimage);
}
list($width, $height) = getimagecoords($earthimages, $earthimage);
if ($setsize > 8 || $setsize < 2) {
    $setsize = 2;
}
$im = @ImageCreate($width, $height) or die("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate($im, 255, 255, 255);
// color table
if ($setcolor == "red") {
    $r = "255";
    $g = "0";
    $b = "0";
} elseif ($setcolor == "white") {
    $r = "255";
    $g = "255";
    $b = "254";
} elseif ($setcolor == "yellow") {