Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Chase Lee
29,275 PointsBuild an Interactive Website >Google Maps Integration >Adding Point Markers to a Map: Geocoding
Hey everyone,
I was doing: Build an Interactive Website >Google Maps Integration >Adding Point Markers to a Map: Geocoding, and in task 1 they ask: 'In "app.js" on line 11 set "geocoder" to a new google.maps namespaced "Geocoder" object.'
Here is my code:
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<style type="text/css">
body, html {
margin:0;
padding:0;
}
body, html, #map {
width:100%;
height:100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAn8fk75K8kCdW6pQ4B7yoBHJNrUbleieY&sensor=false"></script>
<script type="text/javascript" src="app.js">
geocoder = new google.maps.Geocoder();
</script>
</body>
</html>
Thanks in advance!
2 Answers
Andrew Chalkley
Treehouse Guest TeacherYou should be putting your code in the app.js file not the script tag that links to app.js. Any code in a script tag that has it's src attribute set will not get evaluated.
Chase Lee
29,275 PointsThanks Mr Chalkley! I would have never seen that.
Andrew Chalkley
Treehouse Guest TeacherGlad I could help!
Chase Lee
29,275 PointsSorry I didn't specify correctly. The line that I'm having a problem with is:
geocoder = new google.maps.Geocoder();
That's the one I added, and here is what they give me as a hint: Bummer! You need to write the keyword 'new' followed by 'google.maps.Geocoder()'
Thanks.
Alexander Sobieski
6,555 Pointssometimes the code challenge software gets buggy (esp. if you have multiple windows open and copy/paste answers in [versus typing].
Try starting the quiz over from the beginning.
Chase Lee
29,275 PointsI'v refreshed it multiple times but it still doesn't work.
Elliott Frazier
Courses Plus Student 9,647 PointsRemember code challenges are case sensitive. That might be the problem.
Chase Lee
29,275 PointsI don't know where I've gone wrong...I went as far as to copy the code from the project files.
Elliott Frazier
Courses Plus Student 9,647 Pointshmmmm....
Chase Lee
29,275 PointsI'll tag Andrew Chalkley. Maybe he can help.
Sam Donald
36,305 Pointsyou haven't specified var at the beginning. Also, is it written in app.js? it should be!
Ernest Grzybowski
Treehouse Project ReviewerErnest Grzybowski
Treehouse Project ReviewerSorry, I'm not sure what your problem is? What are you having trouble with?