Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:)