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 2/2

Hey guys I'm running into trouble with this one. The code challenge is asking me to: On line 13, set the "address" key in the "geocoderOptions" to "Magic Kingdom, Disney World" However, when I enter what I have, the response is always, "You didn't set Address right"

var mapOptions = {
    center: new google.maps.LatLng(28.42, -81.58),
    zoom: 18,
    mapTypeId: google.maps.MapTypeId.SATELLITE
};

var mapElement = document.getElementById("map");
var theMap = new google.maps.Map(mapElement, mapOptions);
var markers = new Array();

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

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

geocoder.geocode(
    geocoderOptions,
    function(results, status) {
        if(status == google.maps.GeocoderStatus.OK) {
            var location = results[0].geometry.location;

        }
    }
)

What am I doing wrong?

4 Answers

Try putting a colon instead of an equals sign, and put double quotes around both "Disney World" and "Magic Kingdom"

Hope that helps.

Tried that and I'm still getting the same response from the system.

I can't be the only person who is having this problem...

Try coping the code from the project files. Also try searching for the question in the forum.

Thanks for the advice, I figured out that I shouldn't use a comma after the string in adress: