forked from googlearchive/streetsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.html
46 lines (42 loc) · 1.3 KB
/
output.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
<!DOCTYPE html>
<html>
<head>
{{.Header}}
<title>Photo Sphere Custom StreetView</title>
<meta charset="utf-8">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
function initialize() {
var panoOptions = {
pano: 'custom',
visible: true,
panoProvider: getCustomPanorama
};
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano-canvas'), panoOptions);
}
function getCustomPanoramaTileUrl(pano, zoom, tileX, tileY) {
return '{{.ImageFilename}}';
}
function getCustomPanorama(pano, zoom, tileX, tileY) {
if (pano == 'custom') {
return {
location: {
pano: 'custom',
description: 'Custom Street View'
},
tiles: {
tileSize: new google.maps.Size({{.Pano.TotalWidth}}, {{.Pano.TotalHeight}}),
worldSize: new google.maps.Size({{.Pano.TotalWidth}}, {{.Pano.TotalHeight}}),
getTileUrl: getCustomPanoramaTileUrl
}
};
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="pano-canvas" style="height: 500px"></div>
</body>
</html>