Hallo,
hab es nun soweit:
<?php
error_reporting(E_ALL);
$host = "localhost"; // Adresse des Datenbankservers, meistens localhost
$user = "xxx"; // Ihr MySQL Benutzername
$pass = "xx"; // Ihr MySQL Passwort
$db = "xxxxx"; // Name der Datenbank
$link = mysql_connect($host, $user, $pass) or die ("Keine Verbindung zu der Datenbank möglich.");
mysql_select_db($db, $link);
$abfrage1 = "SELECT name, vorname, strasse, plz, ort FROM user";
$ergebnis1 = mysql_query($abfrage1);
$Key = 'xxxxxx';
?>
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php print $Key; ?>" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var map;
function load()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("googlemape"));
geocoder = new GClientGeocoder();
map.setCenter(new GLatLng(50.936796,6.946106), 13);
<?php
while($row = mysql_fetch_object($ergebnis1))
{
?>
showAddress('<?php print $row->name; ?> <?php print $row->vorname; ?>, <?php print $row->strasse; ?>, <?php print $row->plz; ?> <?php print $row->ort; ?>');
<?php
}
?>
}
}
function showAddress(address)
{
if (geocoder)
{
geocoder.getLatLng(
address
,function(point)
{
if (!point)
{
console.log(address + " not found");
}
else
{
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
// marker.openInfoWindowHtml(address);
}
}
);
}
}
window.addEvent('domready', load);
window.addEvent('unload', GUnload);
//]]>
</script>
<div style="width: 605px; height: 360px; overflow: hidden;">
<div id="googlemape" style="width: 605px; height: 360px;"></div>
</div>
aber leider wird mir die Karte nun nicht mehr angezeigt :-( was mache ich denn jetzt falsch?
Gruß,
Micha