forked from GoogleWebComponents/google-streetview-pano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
73 lines (65 loc) · 1.93 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!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-streetview-pano Demo</title>
<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="google-streetview-pano.html">
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
background: black;
}
</style>
</head>
<body unresolved>
<polymer-element name="x-demo" attributes="panoid heading pitch zoom">
<template>
<style>
google-streetview-pano {
display: block;
height: 80%;
}
</style>
<google-streetview-pano panoid="{{panoid}}" heading="{{heading}}" pitch="{{pitch}}" zoom="{{zoom}}" disableDefaultUI>
</google-streetview-pano>
</template>
<script>
Polymer('x-demo', {
heading: 330,
pitch: -2,
zoom: 0.8
});
</script>
</polymer-element>
<x-demo panoid="RjEjGqu4ymMAAAAGOtaGAQ" heading="350" pitch="-2" zoom="0.8">
</x-demo>
<button onclick="showMachu();">Show me Machu Pichu</button>
<button onclick="showBrazil();">Show me Brazil</button>
<button onclick="showStatue();">Show me Statue of Vishnu</button>
<script>
var demo = document.querySelector('x-demo');
function showMachu() {
demo.setAttribute('panoid', 'VsCKIVGfvpEAAAQJKfdW1w');
demo.setAttribute('heading', 330);
demo.setAttribute('pitch', -2);
demo.setAttribute('zoom', 0.8);
}
function showBrazil() {
demo.setAttribute('panoid', 'CkmCkfwvIGUAAAQW-qy0KQ');
demo.setAttribute('heading', 210);
demo.setAttribute('pitch', 15);
demo.setAttribute('zoom', 0.2);
}
function showStatue() {
demo.setAttribute('panoid', 'pVFRQcvJ2IEAAAGuvUxa_w');
demo.setAttribute('heading', 80);
demo.setAttribute('pitch', 7);
demo.setAttribute('zoom', 0.2);
}
</script>
</body>
</html>