map-simple-async.html
changeset 0 5ecce0e1ef52
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/map-simple-async.html	Wed Apr 09 12:36:39 2014 +0200
     1.3 @@ -0,0 +1,38 @@
     1.4 +
     1.5 +
     1.6 +<!DOCTYPE html>
     1.7 +<html>
     1.8 +  <head>
     1.9 +    <title>Asynchronous Loading</title>
    1.10 +    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    1.11 +    <meta charset="utf-8">
    1.12 +    <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
    1.13 +    <script>
    1.14 +function initialize() {
    1.15 +  var mapOptions = {
    1.16 +    zoom: 8,
    1.17 +    center: new google.maps.LatLng(-34.397, 150.644),
    1.18 +    mapTypeId: google.maps.MapTypeId.ROADMAP
    1.19 +  };
    1.20 +
    1.21 +  var map = new google.maps.Map(document.getElementById('map-canvas'),
    1.22 +      mapOptions);
    1.23 +}
    1.24 +
    1.25 +function loadScript() {
    1.26 +  var script = document.createElement('script');
    1.27 +  script.type = 'text/javascript';
    1.28 +  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' +
    1.29 +      'callback=initialize';
    1.30 +  document.body.appendChild(script);
    1.31 +}
    1.32 +
    1.33 +window.onload = loadScript;
    1.34 +
    1.35 +    </script>
    1.36 +  </head>
    1.37 +  <body>
    1.38 +    <div id="map-canvas"></div>
    1.39 +  </body>
    1.40 +</html>
    1.41 +