XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   Site- und Layoutcheck (http://xhtmlforum.de/forumdisplay.php?f=77)
-   -   Google Map auf Homepage will nicht (IE-Problem) (http://xhtmlforum.de/showthread.php?t=36173)

Heart 18.07.2005 11:20

Google Map auf Homepage will nicht (IE-Problem)
 
Hallo,

hoffe, das passt hier rein......

Ich habe mir ein kleines php-Skript in Zusammenarbeit mit der google map api gebastelt, um meine Tipper in einer "Deutschland-Karte" aufzuzeigen.

Das funktioniert mit dem Firefox auch wunderbar, aber der IE lädt die Karte anfangs (siehe Screenshot), aber es kommt dann gleich die Fehlermeldung "Vorgang abgebrochen", bestätigt man diese, gelangt man sofort auf "Die Seite kann nicht angezeigt werden." :roll:

http://imageshark.ath.cx/0815/908555...785a43095b.jpg

Wie bringe ich die google map auch unter dem IE zum Laufen?

Der relevante Code für die Map sieht so aus:
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<script src="http://maps.google.com/maps?file=api&amp;v=1&amp;key=ABQIAAAAaA4uJDvx2Fxgq-2-wQuLSBQA-iRxehV1irWZi9yi8ZPS3CKPuhQJkK7BUjYKZ1lCNRh3sUDDmbI5Dg" type="text/javascript"></script>

</head>
<body>
.....

    <div style="text-align: center; width: 100%;">

    <div id="map" style="margin-left: auto; margin-right: auto; width: 600px; height: 400px; color: #000000; border: 1px solid #000000; text-align: left;"></div>
    <script type="text/javascript">
    //<![CDATA[

    //Map API Documentation http://www.google.com/apis/maps/documentation/

    // Create our "tiny" marker icon
    var icon = new GIcon();
    icon.image = "http://tippliga.m25s11.vlinux.de/img/tipper.png";
    icon.shadow = "http://tippliga.m25s11.vlinux.de/img/spacer.gif";
    icon.iconSize = new GSize(22, 22);
    icon.shadowSize = new GSize(22, 22);
    icon.iconAnchor = new GPoint(11, 11);
    icon.infoWindowAnchor = new GPoint(11, 5);

    var map = new GMap(document.getElementById("map"));
    map.setMapType(_SATELLITE_TYPE);
    map.addControl(new GLargeMapControl());

<?php
if ( (!isset($_REQUEST['ansicht'])) || ( (isset($_REQUEST['ansicht'])) && ($_REQUEST['ansicht'] == "deutschland") ) ) {
    echo "    map.centerAndZoom(new GPoint(11, 50), 12);";
}
if (isset($_REQUEST['ansicht']) && $_REQUEST['ansicht'] == "bayern") {
    echo "    map.centerAndZoom(new GPoint(10.4833, 48.05), 8);";
}
?>


    // Creates a marker whose info window displays the given number
    function createMarker(point, number)
    {
      var marker = new GMarker(point,icon);
      // Show this markers index in the info window when it is clicked
      var html =  number;
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    };


<?php
@mysql_connect($sqlhost, $sqluser, $sqlpass) OR die("Keine Verbindung zur Datenbank. Fehlermeldung:".mysql_error());
mysql_select_db($database) OR die ("Konnte Datenbank nicht benutzen, Fehlermeldung: ".mysql_error());

 $result = mysql_query("SELECT NICK,PLZ,ORT,LIEBLINGSVEREIN,LAENGE,BREITE FROM $tab_tipperkarte WHERE LAENGE != '' OR BREITE != '' ");
 $anzahl = mysql_num_rows($result);

if (!$result)
{
echo "Keine Daten vorhanden!!!";
}
while($row = mysql_fetch_array($result)) {

    $plz = " ". ( $row['PLZ'] > 0 ? " ". $row['PLZ'] ." " : "" ) ." ";
    $ort = " ". ( $row['ORT'] != "" ? " ". $row['ORT'] ." " : "" ) ." ";
    $lieblingsm = " ". ( $row['LIEBLINGSVEREIN'] != "" ? " ". $row['LIEBLINGSVEREIN'] ." " : "[i]keine Angabe<\/i>" ) ." ";

    echo "var point = new GPoint(" . $row['LAENGE'] . "," . $row['BREITE'] . ");\n";
    echo "var marker = createMarker(point, '<b style=\"font-size: 1.3em;\">" . $row['NICK'] . "<\/b>
" . $plz . " " . $ort . "

<u>Lieblingsverein:<\/u>
" . $lieblingsm . "');\n";
    echo "map.addOverlay(marker);\n";
    echo "\n";
}

mysql_close();
?>

//]]>
</script>



(Insgesamt haben bisher <span style="color: #08aa00;"><?php echo $anzahl; ?></span> Tipper Ihre Koordinaten im Profil eingetragen)</p>
</div>

   

 </p>
   

 </p>
    <div style="text-align: center; width: 100%;">
        <a href="tipperkarte.php?ansicht=deutschland">
        [img]img/tipperkarte_D.gif[/img]
        </a>
        <a href="tipperkarte.php?ansicht=bayern">
        [img]img/tipperkarte_BY.gif[/img]
        </a>
    </div>

....

Danke

P.S.: Die Google Map an sich ist auf jedenfall für den IE >5.01 freigegeben, es sollte also klappen....


Alle Zeitangaben in WEZ +2. Es ist jetzt 04:08 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023