sl@0
|
1 |
|
sl@0
|
2 |
|
sl@0
|
3 |
<!DOCTYPE html>
|
sl@0
|
4 |
<html>
|
sl@0
|
5 |
<head>
|
sl@0
|
6 |
<title>Asynchronous Loading</title>
|
sl@0
|
7 |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
sl@0
|
8 |
<meta charset="utf-8">
|
sl@0
|
9 |
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
|
sl@0
|
10 |
<script>
|
sl@0
|
11 |
function initialize() {
|
sl@0
|
12 |
var mapOptions = {
|
sl@0
|
13 |
zoom: 8,
|
sl@0
|
14 |
center: new google.maps.LatLng(-34.397, 150.644),
|
sl@0
|
15 |
mapTypeId: google.maps.MapTypeId.ROADMAP
|
sl@0
|
16 |
};
|
sl@0
|
17 |
|
sl@0
|
18 |
var map = new google.maps.Map(document.getElementById('map-canvas'),
|
sl@0
|
19 |
mapOptions);
|
sl@0
|
20 |
}
|
sl@0
|
21 |
|
sl@0
|
22 |
function loadScript() {
|
sl@0
|
23 |
var script = document.createElement('script');
|
sl@0
|
24 |
script.type = 'text/javascript';
|
sl@0
|
25 |
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' +
|
sl@0
|
26 |
'callback=initialize';
|
sl@0
|
27 |
document.body.appendChild(script);
|
sl@0
|
28 |
}
|
sl@0
|
29 |
|
sl@0
|
30 |
window.onload = loadScript;
|
sl@0
|
31 |
|
sl@0
|
32 |
</script>
|
sl@0
|
33 |
</head>
|
sl@0
|
34 |
<body>
|
sl@0
|
35 |
<div id="map-canvas"></div>
|
sl@0
|
36 |
</body>
|
sl@0
|
37 |
</html>
|
sl@0
|
38 |
|