Example #1
0
      echo("</cache>\n");
    */
    echo "</nonsvg>\n";
    close_svg();
}
function write_css()
{
    $SVG_Output = "<" . chr(63) . "xml version=\"1.0\" encoding=\"UTF-8\"" . chr(63) . ">\n";
    $SVG_Output .= "<" . chr(63) . "xml-stylesheet href=\"css/sr_map.css\" type=\"text/css\"" . chr(63) . ">\n";
    // $SVG_Output .= "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"; // 1.1
    $SVG_Output .= "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\"    \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">";
    echo $SVG_Output;
}
$map_info = new map_info($uid);
//__________________________________ main
$my_map_size = get_mapsize($uid);
define(MINIMAP_SIZE, 150);
define(MINIMAP_X, $my_map_size["width"] - 200);
define(MINIMAP_Y, 30);
write_css();
open_svg("id=\"fSvg\" onload=\"initFather(evt);\" onkeydown=\"key_functions(evt);\" xmlns=\"http://www.w3.org/2000/svg\" externalResourcesRequired=\"true\" xmlns:a=\"http://www.adobe.com/svg10-extensions\" a:timeline=\"independent\" onmousedown=\"evt.preventDefault()\"  onmouseup=\"evt.preventDefault()\" zoomAndPan=\"disable\"");
echo "<rect id=\"hintergrundfarbe\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"#001233\"/>\n";
write_defs();
write_javascript($map_info);
echo "<g id=\"allesDrin\">\n";
write_first_svg_content();
write_panel_svg_content($map_info);
echo "</g>\n";
close_svg();
// mop: siehe oben
$content = ob_get_contents();
function draw_position_rect()
{
    global $uid;
    $map_size = get_mapsize($uid);
    $width = $map_size["width"];
    //-10 wegen dem rand des browsers
    $height = $map_size["height"];
    // -55 wegen der Statuszeile des browsers
    $homecoords = get_homeworld_coords($uid);
    $x = $homecoords[0] - $width / 2;
    $y = $homecoords[1] - $height / 2;
    $SVG_output = "<rect id=\"positionRect\" x=\"" . $x . "\" y=\"" . $y . "\" width=\"" . $width . "\" height=\"" . $height . "\" class=\"minimapPositionRect\" pointer-events=\"none\"/>";
    return $SVG_output;
}