Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

John Locke
9,450 PointsPROBLEM SOLVED: Customizing Google Maps > Adding Info Windows
For some reason, Step 2/3 keeps prompting me to do exactly this, even though I've done it. I guess forward this to the development team, because I can't figure out what's wrong here. Here's the code challenge: http://teamtreehouse.com/library/adding-info-windows
google.maps.event.addListener(marker, "click", function(){});
4 Answers

James Barnett
39,199 Points@John - Rock on with your bad self

John Locke
9,450 PointsI was adding this below the original var declaration of infoWindow, not further down where it needed to be.

sami2
18,678 PointsNot solved for me, I get the error "You need to call 'google.maps.event.addListener()' with 'marker', 'click' and an anonymous function."
This the last 13 lines
geocoder.geocode(
geocoderOptions,
function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
var marker = new google.maps.Marker({map: theMap, position: results[0].geometry.location});
markers.push(marker);
bounds.extend(results[0].geometry.location);
theMap.fitBounds(bounds);
infoWindow = new google.maps.InfoWindow({content: "Magic Kingdom"});
}
}
);
google.maps.event.addListener(marker, "click", function(){});

sami2
18,678 Pointsah ok, solved, misunderstood the question.
geocoder.geocode(
geocoderOptions,
function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
var marker = new google.maps.Marker({map: theMap, position: results[0].geometry.location});
markers.push(marker);
bounds.extend(results[0].geometry.location);
theMap.fitBounds(bounds);
infoWindow = new google.maps.InfoWindow({content: "Magic Kingdom"});
}
google.maps.event.addListener(marker, "click", function(){});
}
)