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

JavaScript

Adding Point Markers to a Map: Geocoding

In "app.js" on line 11 set "geocoder" to a new google.maps namespaced "Geocoder" object.

var geocoder = new google.maps.Geocoder();

That's my code so far... any ideas what i'm doing wrong?

7 Answers

Randomly just worked when I refreshed the page. How annoying.

var geocoder = new google.maps.Geocoder();

var geocoderOptions = {address: "Magic Kingdom, Disney World"};

var marker = new google.maps.Marker({map: theMap, position: addressLocation});

This is my current code and i'm certain it is correct! Keep getting 'Bummer: null' error.

P.s. it seems to carrry over random incomplete code from each of the past challenges. Even when I move to a new challenge it loads it back into the app.js

Even on the next topic, the code seems to pull over from the last challenge on a previous topic and the only error I ever get is "bummer! null'. Think it's a major bug :(

If you think you found a bug, email the Treehouse support team directly at help@teamtreehouse.com so they can check it out.

The following is not working for me either:

<script type="text/javascript" src="app.js"> var geocoder = new google.maps.Geocoder(); </script>

Have also tried, per the code in the lesson file: geocoder = new google.maps.Geocoder();

Has it been determined whether or not this is a bug, or am I missing something in my code? Thanks.

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hi Eric,

Can you show your code in context with the rest of the code please?

You can also indent it with four spaces at the beginning of each line for code formatting.

Regards Andrew

Hi guys,

Maybe you are doing the same mistake as me. The code should be entered in the app.js file, not between the <script> tag in index.html.

geocoder = new google.maps.Geocoder();

Hope this helps...