PDA

View Full Version : google maps Info window popups not closing



erich.oliphant
1 Aug 2011, 10:09 AM
Hi I have a mapping app that pops up info windows when you click a marker. For some reason, the close 'x' icon/control doesn't seem to work.

here's the function that creates the marker and associated popup:



function createMarker(latlng, name, address, descr, link, related, type,map) {

var markerOptions = new Object();

markerOptions.fillStyle = categories[type].color;

var html = "<div id='bodyContent'><a target='_info' href='"+ link + "'>"+descr+"</a><br/>"+ " <br/>" + address+"</div>";

var marker = new google.maps.Marker({
map: map.map,
position: latlng,
icon : categories[type].image
});
var infowindow = new google.maps.InfoWindow({

content : html
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});


}


Any ideas would be greatly appreciated. As this is a pretty straightforward use case, I'm a bit stumped about what the problem might be

chrise86
28 Oct 2011, 1:22 AM
I'm having the same problem, did you manage to solve it?

minorbug
5 Dec 2011, 10:45 PM
Also having the same problem.