Simon
Simon

Reputation: 1719

Loading google maps API using head.js

I'm trying to do something I thought quite straight forward. Obviously it's not! I use the head.js lib to asynchronously load the Google Maps API :

<!doctype html>
<html> 
<head> 
    <title>Map - Async example</title> 
</head> 
<body>
    <div id="id" style="width:600px;height:400px;"></div>
    <script src="header.js" type="text/javascript">
    <script type="text/javascript">
        head.js('https://maps.googleapis.com/maps/api/js?=3.exp&sensor=false&callback=google_callback');
        var google_callback = function ( ) {
            var mapOptions = {
                zoom: 8,
                center: new google.maps.LatLng(-34.397, 150.644),
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };

            var map = new google.maps.Map(document.getElementById('id'), mapOptions);
        }
    </script>
</body>
</html>

But nothing shows up. Any idea/suggestion ?

Upvotes: 0

Views: 478

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117314

The closing script-tag for header.js is missing

Upvotes: 1

Related Questions