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

Issues with setting Google Maps markers using JQuery

im stuck on this question and i dont know what to do to make it right, PLEASE HELP.

In app.js, on line 20, initialize a new marker with the 'map' set to 'theMap' and the 'position' set to 'addressLocation'

the line of code i have is: var marker = new google.maps.Marker({map: theMap, posotion: addressLocation});

why isnt this working? i cant figure it out.

Thanks

David, in your original post, the word "position" is spelled incorrectly. You have "posotion". This worked for me:

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

worked^

3 Answers

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

Check your spelling of position inside the ()

Luc Dejardin
Luc Dejardin
3,072 Points

No, it don't work either, dono why.

John Glynn
John Glynn
8,239 Points

Did you make sure it was in the app.js tab? That's what threw me off, the above code worked for me.

Luc Dejardin
Luc Dejardin
3,072 Points

Yes, it was probably a bug cuz it ended by working with the same code.

How did you finally get this to work? I have the same code... tried yesterday and am now trying it again today.

var marker = new google.maps.Marker({map: theMap, position: addressLocation});
Gagandeep Virk
Gagandeep Virk
19,741 Points

Hi All, I am having little problem in the adding static maps code challenge of question 4, I don't know what I am doing wrong? Can someone help me please? The question is Set the query parameter of "size" to 400 by 300 and my answer is &size=400×300"

John Coughlan
John Coughlan
9,414 Points

Hi there, I used a very similar bit of code to yours, but used the letter 'x' between the numbers: &size=400x300"

It worked for me so hopefully that helps!