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 a Dynamic Map

hey guys!! Is there anyone who can help me with this, the question is: In the "mapOptions" object set the "center" key to a new google.maps namespaced "LatLng" object with the arguments of 28.42 and -81.58......this is my code and I don't understand why it doesn't work?

var mapOptions = {center: new google.maps.LatLng(28.42, -81.58)};

2 Answers

Colin Lewis
Colin Lewis
9,021 Points

I don't either because I just cut and paste that into mine and it worked.

Randy Wang
Randy Wang
9,291 Points

Works for me...

var mapOptions = { center: new google.maps.LatLng(28.42, -81.58) };