Habe mich lange nicht mehr hier blicken lassen... Nun brauche ich aber mal wieder Eure geschätzte Hilfe. Hier bekommt man meist doch schneller eine Antwort als anderswo
Für ein Uniprojekt habe ich eine Googlemaps Karte mit acht Markern. Die Marker werden in einem Array generiert. Nun soll, so die Vorgabe, beim Click auf die Marker je ein spezifisches Fenster mit Informationen aufpoppen. Ich weiß, Pop-Ups sind Bäh, aber Vorgabe ist Vorgabe... Ich habe alles, bis auf die Pop-Ups. Ein den Markern zugewiesenes Alert funktioniert. Beim Popup geht ein neuer Tab auf und Firefox sagt, er könne 'undefined' nicht finden. Irgendeine Idee?
Dank im Vorraus!
// JavaScript Document
var aLatLng =[
{"lat":52.1326, "lon": 5.2912},//the Netherlands
{"lat":-14.2350, "lon":-51.9252},//Brazil
{"lat":-32.5227, "lon": -55.7658}, //Uruguay
{"lat":7.9465, "lon":-1.0231}, //Ghana
{"lat":-38.4160, "lon":-63.6166}, //Argentina
{"lat":51.1656, "lon":10.4515}, //Germany
{"lat":-23.4425, "lon":-58.4438}, //Paraguay
{"lat":40.4636, "lon": -3.7492} //Spain
];
function myInitialize() {
var latlng = new google.maps.LatLng(53.12, -35.50);
var myOptions = {
zoom: 2,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
for(var i=0; i<aLatLng.length; i++){
var point = new google.maps.LatLng(aLatLng
.lat, aLatLng[i].lon );
var marker = new google.maps.Marker({
position: point,
map: map
});
google.maps.event.addListener(marker, 'click', buildClickHandler(i));
}
}
var myPages = new array(netherlands.html, brazil.html, uruguay.html, ghana.html, argentina.html, germany.html, paraguay.html, spain.html);
function buildClickHandler(i) {
return function() {
//open popup window: page[i])
//alert("hello. This is number for popup no:" + i);
//alert("hello. This is number for popup no: " + aLatLng[i].file + "soon");
//aLatLng[i].file.thisWidth
window.open(aLatLng[i].file, scrollbars="no")
};
}