forked from GuillaumeLeclerc/vue-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 475
/
Copy pathstreet-view-pano.html
58 lines (52 loc) · 1.7 KB
/
street-view-pano.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
<head>
<style>
.pano {
width: 500px;
height: 300px;
}
</style>
</head>
<body>
<div id="root">
<h1>Panorama at Pembroke College, Cambridge, facing North, looking slightly upwards (10 degrees)</h1> Point-of-view updates when you pan around
<gmap-street-view-panorama class="pano" :position="{lat: 52.201272, lng: 0.118720}"
:pov="pov" :zoom="1" @pano_changed="updatePano" @pov_changed="updatePov">
</gmap-street-view-panorama>
<ul>
<li>Heading: {{pov && pov.heading}} <button @click="pov.heading = Math.random() * 360">Change</button></li>
<li>Pitch: {{pov && pov.pitch}} <button @click="pov.pitch = Math.random() * 180 - 90">Change</button></li>
<li><button @click="pov.pitch = Math.random() * 180 - 90, pov.heading = Math.random() * 360">Change Both</button></li>
<li>Pano ID: {{pano}}</li>
</ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.0/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.js"></script>
<script src="vue-google-maps.js"></script>
<script>
Vue.use(VueGoogleMaps, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc',
libraries: 'places'
},
// Demonstrating how we can customize the name of the components
installComponents: true,
});
document.addEventListener('DOMContentLoaded', function() {
new Vue({
el: '#root',
data: {
pov: null,
pano: null,
},
methods: {
updatePov(pov) {
this.pov = pov;
},
updatePano(pano) {
this.pano = pano;
}
}
});
});
</script>
</body>