forked from GoogleWebComponents/google-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
42 lines (37 loc) · 1.38 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<!-- Copyright (c) 2014 Google Inc. All rights reserved. -->
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Google Map demo</title>
<script src="../platform/platform.js"></script>
<link rel="import" href="google-map.html">
<link rel="import" href="google-map-directions.html">
<style>
#controlsToggle {
position: absolute;
left: 10%;
bottom: 10%;
}
</style>
</head>
<body fullbleed unresolved>
<google-map latitude="37.779" longitude="-122.3892" minZoom="9" maxZoom="11" fit>
<google-map-marker latitude="37.779" longitude="-122.3892"
title="Go Giants!" draggable="true">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/49/San_Francisco_Giants_Cap_Insignia.svg/200px-San_Francisco_Giants_Cap_Insignia.svg.png" />
</google-map-marker>
</google-map>
<google-map-directions startAddress="San Francisco" endAddress="Mountain View"></google-map-directions>
<button id="controlsToggle" onclick="toggleControls()">Toggle controls</button>
<script>
var gmap = document.querySelector('google-map');
gmap.addEventListener('api-load', function(e) {
document.querySelector('google-map-directions').map = this.map;
});
function toggleControls() {
gmap.disableDefaultUI = !gmap.disableDefaultUI;
}
</script>
</body>
</html>