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 Build an Interactive Website Google Maps Integration Adding a Dynamic Map

Adding a dynamic map

My map will not show... Its just giving me a broken image.. here is my code

    <link rel="stylesheet" href="style.css" type="text/css"/>
    <div id="locations" class="grid_12">
    <div class="map">
        <p class="static_map"> <img src= "http://maps.googleapis.com/maps/api/staticmap?key=AIzaSyCVDleBGSnjUA8BtctXE6hjxvHSzjp-Xik&size=400x300&sensor=false&markers=1014+Miami+Springs+Rd+Longwood,+FL+32779" alt="1014 Miami Springs Rd,
            Longwood, FL 32779"> </p>

<script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCVDleBGSnjUA8BtctXE6hjxvHSzjp-Xik&sensor=false"> </script> <script type="text/javascript"> $(.locations).prepend('<div class="map"> </div>') $(".static_map").remove(); function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById("map"), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); initialize(); </script>

html </body> </html>```

3 Answers

I tried formatting that code for you, but it proved to be a bigger challenge than I expected : )

Thanks for trying:)