Der Praktikant
Grünschnabel
Hallo alle zusammen 
muss mich derzeit mit Google Maps rumschlagen und hab da kaum Erfahrung mit. Ich hab Java Grundwissen und somit schonmal im Stande zumindestens aus fertigen Codes was zusammen zu copy&pasten.
Folgendes will mir einfach nicht gelingen und ich finde auch den Fehler nicht :
openInfoWindowHtml innerhalb des Event Listener sowie showMapBlowup() funktioniert einfach nicht. alert und InfoWindow funktionieren aber schon. Wer kann mir da helfen und sagen wieso ausgerechnet die anderen 2 nicht funktionieren ?
EDIT : Wahrscheinlich wird es daran liegen : "Things have changed significantly in Google Maps v3. The InfoWindow now has a constructor and openInfoWindow()or openInfoWindowHtml() have been removed."
Dann noch eine andere Frage, wieso werden diese InfoFenster so eckig und hässlich angezeigt ? Am liebsten wären mir solche runden wie hier : http://lndw.org/images/gmaps_bubble.gif

muss mich derzeit mit Google Maps rumschlagen und hab da kaum Erfahrung mit. Ich hab Java Grundwissen und somit schonmal im Stande zumindestens aus fertigen Codes was zusammen zu copy&pasten.
Folgendes will mir einfach nicht gelingen und ich finde auch den Fehler nicht :
openInfoWindowHtml innerhalb des Event Listener sowie showMapBlowup() funktioniert einfach nicht. alert und InfoWindow funktionieren aber schon. Wer kann mir da helfen und sagen wieso ausgerechnet die anderen 2 nicht funktionieren ?
EDIT : Wahrscheinlich wird es daran liegen : "Things have changed significantly in Google Maps v3. The InfoWindow now has a constructor and openInfoWindow()or openInfoWindowHtml() have been removed."
Dann noch eine andere Frage, wieso werden diese InfoFenster so eckig und hässlich angezeigt ? Am liebsten wären mir solche runden wie hier : http://lndw.org/images/gmaps_bubble.gif
HTML:
<!DOCTYPE html>
<html DIR="LTR">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Deutschland | Düsseldorf - Köln</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(51.0936851, 6.8289112);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var image = 'images/flag-red.gif';
var ddorfcoords = new google.maps.LatLng(51.220532, 6.8100617);
var marker1 = new google.maps.Marker({
position: ddorfcoords,
map: map,
icon: image
// animation: google.maps.Animation.DROP,
// title:"Düsseldorf"
});
var image = 'images/flag-green.gif';
var koelncoords = new google.maps.LatLng(50.9580867, 6.9204493);
var marker2 = new google.maps.Marker({
position: koelncoords,
map: map,
icon: image
// animation: google.maps.Animation.DROP,
// title:"Köln"
});
var infowindow1 = new google.maps.InfoWindow({content: "<p>Düsseldorf - ROT</p>"});
google.maps.event.addListener(marker1, 'click', function() {
//marker1.showMapBlowup(); /* Funkt. nicht */
// marker1.openInfoWindowHtml('text'); /* Funkt. nicht */
infowindow1.open(map,marker1);
});
var infowindow2 = new google.maps.InfoWindow({content: "<p>Köln - GRÜN</p>"});
google.maps.event.addListener(marker2, 'click', function() {
// marker2.showMapBlowup(); /* Funkt. nicht */
// marker2.openInfoWindowHtml('text'); /* Funkt. nicht */
infowindow2.open(map,marker2);
});
}
</script>
</head>
<body onload="initialize();">
<div id="map_canvas"></div>
</body>
</html>
Zuletzt bearbeitet: