forked from mistic100/Photo-Sphere-Viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin-visible-range.html
More file actions
76 lines (69 loc) · 2 KB
/
Copy pathplugin-visible-range.html
File metadata and controls
76 lines (69 loc) · 2 KB
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
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PhotoSphereViewer - visible range demo</title>
<link rel="stylesheet" href="../dist/photo-sphere-viewer.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="photosphere"></div>
<script src="../node_modules/three/build/three.js"></script>
<script src="../node_modules/uevent/browser.js"></script>
<script src="../dist/photo-sphere-viewer.js"></script>
<script src="../dist/plugins/visible-range.js"></script>
<script>
const ranges = {
longitudeRange: [-Math.PI / 2, Math.PI / 2],
latitudeRange : [-Math.PI / 3, Math.PI / 3],
};
const viewer = new PhotoSphereViewer.Viewer({
container : 'photosphere',
panorama : 'sphere_cropped.jpg',
caption : 'Parc national du Mercantour <b>© Damien Sorel</b>',
loadingImg: 'assets/photosphere-logo.gif',
panoData : {
fullWidth: 6000,
fullHeight: 3000,
croppedX: 700,
croppedY: 700,
croppedWidth: 4000,
croppedHeight: 1260,
},
navbar : [
'autorotate',
{
content : 'Clear range',
className: 'custom-button',
onClick : () => {
visibleRange.setLongitudeRange(null);
visibleRange.setLatitudeRange(null);
},
},
{
content : 'Set range',
className: 'custom-button',
onClick : () => {
visibleRange.setLongitudeRange(ranges.longitudeRange);
visibleRange.setLatitudeRange(ranges.latitudeRange);
},
},
{
content : 'Set range from panoData',
className: 'custom-button',
onClick : () => {
visibleRange.setRangesFromPanoData();
},
},
'caption',
'fullscreen',
],
plugins : [
[PhotoSphereViewer.VisibleRangePlugin, ranges],
],
});
const visibleRange = viewer.getPlugin(PhotoSphereViewer.VisibleRangePlugin);
</script>
</body>
</html>